activerecord: detect if an association attribute has changed

Hi,

just a quick question, cause so far I was nt able to find a nice and clean solution.

Let s assume an apple belongs_to a tree. Now I would like to be able to detect in the apple model that the tree has changed. I would like to be able to detect changes if either apple.tree_id or apple.tree is changed.

Any ideas?

Hi,

Wow, I cannot believe that their is no easy way to detect if an association attribute has changed???

I think it s not uncommon that you have to do some work if an attribute changes... so ....