Max Williams wrote: > Hi Michael - i kind of expected that kind of reply :) > > The reason that i'm doing it in this case is that i've overridden the > set method for one of my foreign keys to do some other stuff after > changing the foreign key. But, it just occurred to me that a better way > to handle that is via a dirty models sort of approach of not getting > involved in the set method but detecting the change instead. What's the > simplest way to do that, do you know?
OT: This is a slightly off-topic reply, but this really makes me appreciate Key Value Observing (KVO) from the world of Cocoa. http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/KeyValueObserving/Concepts/Overview.html#//apple_ref/doc/uid/20001837 If Rails had such a mechanism you could register to observe changes to the relationship and perform your additional stuff anytime a change was detected. Well, one can dream anyway. -- Posted via http://www.ruby-forum.com/. -- 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.

