# ActiveRecord - counter\_cache =\> true no update of record

**URL:** <https://www.ruby-forum.com/t/activerecord-counter-cache-true-no-update-of-record/128690>\
**Category:** Rails\
**Created:** [February 10, 2008, 3:33pm UTC](https://www.ruby-forum.com/t/activerecord-counter-cache-true-no-update-of-record/128690 "2008-02-10T15:33:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [February 10, 2008, 3:33pm UTC](https://www.ruby-forum.com/t/activerecord-counter-cache-true-no-update-of-record/128690/1 "2008-02-10T15:33:59Z")

</div>

Hello , I’ld need some help (read it could be a bug … patch coming in  
2.0.3 ?)

I have hm / bt relationships

class User \< ActiveRecord::Base  
has\_many :infos, :dependent =\> :destroy

class Info \< ActiveRecord::Base  
belongs\_to :user , :counter\_cache =\> true

when creating a new info instance, the ‘infos\_count’ column in the  
users table is not incremented

infos\_controller.rb  
def create  
@info = Info.new(params[:info])  
@info.valid\_until = params[:valid\_until]  
…  
if @info.save  
current\_user.infos \<\< @info#user\_id inserted in info but  
infos\_count not updated in user record  
current\_user.reload  
else  
format.html { render :action =\> “new” }  
end  
end
