Added ActiveRecord::Base.transaction to speed up.

This commit is contained in:
Martin Edenhofer 2015-07-06 08:22:17 +02:00
parent 9adc5d618f
commit 8f3d57c0ae

View file

@ -173,7 +173,7 @@ returns
merge model references to other model merge model references to other model
result = Models.merge('User', 2, 4711) result = Models.merge('User', 2, 4711) # Object, object_id_of_primary, object_id_which_should_be_merged
returns returns
@ -209,9 +209,11 @@ returns
} }
# update items # update items
items_to_update.each {|_id, item| ActiveRecord::Base.transaction do
item.save items_to_update.each {|_id, item|
} item.save
}
end
} }
true true
end end