motion-prime/models/association.rb in motion-prime-0.1.3 vs motion-prime/models/association.rb in motion-prime-0.1.4
- old
+ new
@@ -68,11 +68,11 @@
end
define_method("#{association_name}_attributes=") do |value|
self.send(bag_name).clear
association = association_name.classify.constantize.new
- association.sync_with_attributes(value)
+ association.fetch_with_attributes(value)
association.save
self.send(:"#{bag_name}") << association
association
end
define_method("#{association_name}") do
@@ -95,10 +95,10 @@
self.send(bag_name).clear
association = []
value.each do |attrs|
model = association_name.classify.constantize.new
- model.sync_with_attributes(attrs)
+ model.fetch_with_attributes(attrs)
association << model
end
self.send(:"#{bag_name}=", association)
association
end
\ No newline at end of file