On Jun 27, 10:29 am, Arkadiusz Młynarczyk <[email protected]> wrote:
> I've read in rails api that there is a touch parameter and I want to

It's not in rails 2.3.2.

Fred
> 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to