I've read in rails api that there is a touch parameter and I want to use it in my application. I have something like that class User < ActiveRecord::Base has_many :phones
after_update :updated
def updated ... end end
class Phone < ActiveRecord::Base belongs_to :user, :touch => true end
I want that every change of any phone number would change User updated_at and also call user after_update callback.
But when I add :touch parameter I get error that looks like:
ArgumentError: Unknown key(s): touch from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/ active_support/core_ext/hash/keys.rb:47:in `assert_valid_keys' from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/ associations.rb:1506:in `create_belongs_to_reflection' from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/ associations.rb:994:in `belongs_to' from (eval):3:in `belongs_to' from /Users/arkadiuszmlynarczyk/TapConference/app/models/phone.rb:2