aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/delegation.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-01-26 12:37:29 -0700
committerSean Griffin <sean@thoughtbot.com>2015-01-26 12:37:29 -0700
commit1152219fa2d7968f864b3a5ebb78d2f95ca4fb5c (patch)
tree21a23a8e4b918f992f0f38e4fa7fa78d47f28468 /activerecord/lib/active_record/relation/delegation.rb
parent8e3b1a632c15e8c7f708ab222a81faaad8e3410e (diff)
downloadrails-1152219fa2d7968f864b3a5ebb78d2f95ca4fb5c.tar.gz
rails-1152219fa2d7968f864b3a5ebb78d2f95ca4fb5c.tar.bz2
rails-1152219fa2d7968f864b3a5ebb78d2f95ca4fb5c.zip
Improve consistency of counter caches updating in memory
When we made sure that the counter gets updated in memory, we only did it on the has many side. The has many side only does the update if the belongs to cannot. The belongs to side was updated to update the counter cache (if it is able). This means that we need to check if the belongs_to is able to update in memory on the has_many side. We also found an inconsistency where the reflection names were used to grab the association which should update the counter cache. Since reflection names are now strings, this means it was using a different instance than the one which would have the inverse instance set. Fixes #18689 [Sean Griffin & anthonynavarre]
Diffstat (limited to 'activerecord/lib/active_record/relation/delegation.rb')
0 files changed, 0 insertions, 0 deletions