Hello,
I face a problem using the new Rails 2.3.3 :touch option along with the :autosave option.
My app have three models: User, Group and Membership
class User < ActiveRecord::Base # attribute: name
has_many :memberships, :dependent => :destroy accepts_nested_attributes_for :memberships, :allow_destroy => true, :reject_if => proc { |attributes| attributes ['group_id'].blank? } # Having "accepts_nested_attributes_for :memberships" makes :autosave option true for the "has_many :memberships" association. has_many :groups, :through => :memberships end
class Membership < ActiveRecord::Base # attributes: user_id, group_id, content belongs_to :user, :touch => true belongs_to :group, :touch => true end
class Group < ActiveRecord::Base # attribute: name has_many :memberships, :dependent => :destroy has_many :users, :through => :memberships end
You can see my problem in this console script:
user = User.find 1
User Load (1.6ms) SELECT * FROM "users" WHERE ("users"."id" = 1)