On Tue, Feb 16, 2010 at 7:04 PM, Greg Donald <[email protected]> wrote: > On Tue, Feb 16, 2010 at 6:59 PM, Robert Walker <[email protected]> wrote: >> 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. > > You can easily detect a foreign key change with a filter in the model:
Or even better: http://www.railsapi.com/doc/rails-v2.3.5/classes/ActiveRecord/Callbacks.html -- Greg Donald destiney.com | gregdonald.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.

