def check_infinite_nest(klass) # :nodoc:
      raise "infinite nest detected" if klass == self

      klass.configs.each_value do |config|
        if config.type.kind_of?(NestType)
          check_infinite_nest(config.type.configurable.class)
        end
      end
    end
def check_infinite_nest(klass) # :nodoc:
      raise "infinite nest detected" if klass == self

      klass.configs.each_value do |config|
        if config.type.kind_of?(NestType)
          check_infinite_nest(config.type.configurable.class)
        end
      end
    end
helper to recursively check for an infinite nest