[Rails] Re: Re: Update association on foreign key change?

2010-02-17 Thread Max Williams
Greg Donald wrote: On Tue, Feb 16, 2010 at 7:04 PM, Greg Donald gdon...@gmail.com wrote: 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 |

[Rails] Re: Re: Update association on foreign key change?

2010-02-16 Thread Max Williams
Thanks a lot Michael I ended up doing your second suggestion, shying away from the rails magic since i couldn't seem to really control it. Personally it seems most natural to me for rails to work the association magic when either the foreign key is changed or the direct association set method

Re: [Rails] Re: Re: Update association on foreign key change?

2010-02-16 Thread Jim Tobin
Wouldn't ActiveRecord Observer class do what you're looking for? On Feb 16, 2010, at 1:08 AM, Max Williams wrote: Thanks a lot Michael I ended up doing your second suggestion, shying away from the rails magic since i couldn't seem to really control it. Personally it seems most natural