On Sep 21, 12:10 pm, Sunny Bogawat <[email protected]> wrote: > i have form having user and addresses field when i am editing user and > after updating user inside user model i am checking for any field from > user get dirty using @self.changed? method it giving me proper output in > this i am doing @self.address.changed?( I Have polymorphic association > in user and addresses) but it is giving me nil/false if address is > changed but if i am putting �[email protected]? in address model it is > giving me proper output. > > Please anybody explain me how to use dirty object concept with model > association or with nested attributes? >
Just a hunch, but I think that by the time your after_update runs the associated objects have already finished saving (so their list of dirty attributes have clearer). You could validate this by stepping through AR's save code. Fred -- 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.

