lib/jimmy/schema_creation.rb in jimmy-0.1.0 vs lib/jimmy/schema_creation.rb in jimmy-0.1.1

- old
+ new

@@ -30,15 +30,17 @@ def method_missing(method, *args, &block) if SchemaTypes.key? method handler = SchemaCreation.handlers[self.class] self.class.__send__ :define_method, method do |*inner_args, &inner_block| handler_args = handler && inner_args.shift(handler.arity - 1) - schema = Schema.create(method, domain, *inner_args, &inner_block) + schema = Schema.new(method, domain, *inner_args, &inner_block) instance_exec schema, *handler_args, &handler if handler schema.dsl end return __send__ method, *args, &block end + + domain.autoload_type method if domain.types.key? method return instance_exec method, *args, &SchemaCreation.handlers[self.class] end