Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

Same deal here, although it is far classier to present the bug as a
failed test. The memory version of Document isn't updating on the
create, although the increment SQL was geerated. Thus, the save of
Doc overwrites the properly updated database info so that the reload
has the old, pre-creation, value of the counter cache.
This really used to work for me -- don't know where it went bad.
I'm working on a scratch 1.2.2 install.