# Problem with :touch in belongs\_to

**URL:** <https://www.ruby-forum.com/t/problem-with-touch-in-belongs-to/171176>\
**Category:** Rails\
**Created:** [June 27, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/problem-with-touch-in-belongs-to/171176 "2009-06-27T19:46:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arkadiusz\_MSSSS\_yna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f9ae1b/32.png) [@Arkadiusz\_MSSSS\_yna](https://www.ruby-forum.com/u/Arkadiusz_MSSSS_yna)\
**Post date:** [June 27, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/problem-with-touch-in-belongs-to/171176/1 "2009-06-27T19:46:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Arkadiusz\_MSSSS\_yna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f9ae1b/32.png) [@Arkadiusz\_MSSSS\_yna](https://www.ruby-forum.com/u/Arkadiusz_MSSSS_yna)\
**Post date:** [June 27, 2009, 8:19pm UTC](https://www.ruby-forum.com/t/problem-with-touch-in-belongs-to/171176/2 "2009-06-27T20:19:58Z")

</div>

On Jun 27, 10:29 am, Arkadiusz M³ynarczyk [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
