I have added counter_cache
to punching_bag
gem. Everything works fine in Development ENV
, but in Production ENV
it doesn't do what it suppose to to.
I can see that punches_count
column is added into my posts
table, but it doesn't increment
the column.
Why this is happening and what can I do to fix it?
In Post
model add following:
attr_accessor :punches_count
has_many :punches