aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-04-06 19:17:54 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-04-06 19:17:54 -0300
commitd5f80655f9d285cf569ec28e741bbc4bd16e6599 (patch)
treef235d56f2c0bd97486a0634297fbf7aa1fca8f15 /activerecord/lib/active_record
parent8b88df94ebda2e829782f514ff51caeaf5e694dd (diff)
parente646d3bf574ad3ea7dc5b525511377559b2640dc (diff)
downloadrails-d5f80655f9d285cf569ec28e741bbc4bd16e6599.tar.gz
rails-d5f80655f9d285cf569ec28e741bbc4bd16e6599.tar.bz2
rails-d5f80655f9d285cf569ec28e741bbc4bd16e6599.zip
Merge pull request #19647 from codeout/association_update
Fix a regression introduced by removing unnecessary db call when replacing
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index 88531205a1..6caadb4ce8 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -370,6 +370,8 @@ module ActiveRecord
replace_common_records_in_memory(other_array, original_target)
if other_array != original_target
transaction { replace_records(other_array, original_target) }
+ else
+ other_array
end
end
end