diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-06-15 19:16:30 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-06-16 09:40:16 -0600 |
commit | e6690d37204dbd7154d275df75d9d0f98f5d2526 (patch) | |
tree | e4485022f5f2e8e1c42581cf968184a9b50b07aa /activerecord/lib/active_record.rb | |
parent | f59ed560ac68aad47e56b6b0442b0b855ae9951e (diff) | |
download | rails-e6690d37204dbd7154d275df75d9d0f98f5d2526.tar.gz rails-e6690d37204dbd7154d275df75d9d0f98f5d2526.tar.bz2 rails-e6690d37204dbd7154d275df75d9d0f98f5d2526.zip |
Always update counter caches in memory when adding records
Before, calling `size` would only work if it skipped the cache, and
would return a different result from the cache, but only if:
- The association was previously loaded
- Or you called size previously
- But only if the size was 0 when you called it
This ensures that the counter is appropriately updated in memory.
Diffstat (limited to 'activerecord/lib/active_record.rb')
0 files changed, 0 insertions, 0 deletions