This project is archived and is in readonly mode.

#5772 ✓ stale
Erik van Eykelen

Calling a model "Update" leads to unexpected behavior

Reported by Erik van Eykelen | October 8th, 2010 @ 07:31 PM

When you have these two models:

class Update < ActiveRecord::Base
has_many :comments end

and

class Comment < ActiveRecord::Base
belongs_to :update end

then issuing Comment.first.update_attribute(:body,"This fails to be saved") fails to save.

When you rename the Update model to e.g. Post then update_attribute works correctly.

It fails under Rails 3 and 2.3.8, it works under 2.3.5.

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 »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

Pages