lib/virtus/attribute/embedded_value.rb in virtus-1.0.0.beta7 vs lib/virtus/attribute/embedded_value.rb in virtus-1.0.0.beta8
- old
+ new
@@ -64,11 +64,12 @@
def self.handles?(klass)
klass.is_a?(Class) && TYPES.any? { |type| klass <= type }
end
# @api private
- def self.build_type(options)
- Axiom::Types::Object.new { primitive options[:type] }
+ def self.build_type(definition)
+ klass = definition.primitive.is_a?(Class) ? definition.primitive : definition.type
+ Axiom::Types::Object.new { primitive klass }
end
# @api private
def self.build_coercer(type, _options)
primitive = type.primitive