I am rather confused about what I’m seeing with an attribute of mine
that has been defined as a counter_cache.
‘votes_count’ is the attribute that is a counter_cache var.
If I do this in my view…
<% p test.attributes %>
<% p test[:votes_count] %>
<% p test.votes_count %>
I get this printed out…
Why does test.votes_count give me 1?
If I do a test.reload before calling those prints, then test.votes_count
gives me the correct value of 11.
Can somebody tell me why I’m seeing these results?