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