lib/custom_fields/extensions/mongoid/relations/referenced/many.rb in custom_fields-2.0.0.rc4 vs lib/custom_fields/extensions/mongoid/relations/referenced/many.rb in custom_fields-2.0.0.rc5
- old
+ new
@@ -10,9 +10,11 @@
def build_with_custom_fields(attributes = {}, options = {}, type = nil)
if base.respond_to?(:custom_fields_for?) && base.custom_fields_for?(metadata.name)
# all the information about how to build the custom class are stored here
recipe = base.custom_fields_recipe_for(metadata.name)
+ attributes ||= {}
+
attributes.merge!(:custom_fields_recipe => recipe)
# build the class with custom_fields for the first time
type = metadata.klass.klass_with_custom_fields(recipe)
end
\ No newline at end of file