aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-10-12 13:25:21 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-10-12 13:25:21 -0700
commit84c37741e005b3ac6807be1caf5255c041f12693 (patch)
treede50bcacd34633b7cf275544c83cf24ea4b1149c /activerecord/lib/active_record
parenteefb34438563b6b58e65b2ac0e06c543f76e2247 (diff)
parent990a938cf7527b654cef06674f25f3632920bad7 (diff)
downloadrails-84c37741e005b3ac6807be1caf5255c041f12693.tar.gz
rails-84c37741e005b3ac6807be1caf5255c041f12693.tar.bz2
rails-84c37741e005b3ac6807be1caf5255c041f12693.zip
Merge pull request #7925 from ernie/3-2-fix-collection-associations-with-select
Fix has_many assocation w/select load after create
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index 67a1e457be..2c852f6efc 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -409,7 +409,7 @@ module ActiveRecord
if mem_index
mem_record = memory.delete_at(mem_index)
- (record.attribute_names - mem_record.changes.keys).each do |name|
+ ((record.attribute_names & mem_record.attribute_names) - mem_record.changes.keys).each do |name|
mem_record[name] = record[name]
end