This project is archived and is in readonly mode.

#5365 ✓committed
Neil Middleton

Touch-ing with counter cache results in an erro

Reported by Neil Middleton | August 12th, 2010 @ 03:56 PM

We have two models, one of 'things' and one of 'likes'

The relationship is :


has_many :likes


belongs_to :thing, :counter_cache => :like_count, :touch => :true

If I then create a like against a thing the attached stack is returned with:

NoMethodError: undefined method true=' for #<Thing:0x2b2c49df9788>

Removing :touch => :true from the Likes model makes the error go away, but then leaves your Thing model with a stale timestamp which is a bad thing.

This worked in all previous Rails 3.0 beta's but now appears to have changed.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>


Referenced by