rails/rails — pull request #15747 by sgrif (2014-06-16 01:19:34+00:00)
Title: 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.