I am using rails 2.3, and have overridden an attribute. I am building a before_save callback, and would like to check if the attribute has changed - but can''t figure out a way to do this. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/edef158e-70a3-4aea-80dd-c18b7a2eb3da%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
tonypm
2013-Aug-10 06:48 UTC
Re: accessing the changed? method for an overridden attribute - sorry - non question
On Friday, 9 August 2013 18:04:54 UTC+1, tonypm wrote:> I am using rails 2.3, and have overridden an attribute. > > I am building a before_save callback, and would like to check if the > attribute has changed - but can''t figure out a way to do this. > > >Sorry - silly Friday afternoon question. changed? method applies to the object as a whole, to test if an attribute has changed, should have used attrname_changed? which of course hasn''t been overridden. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/058af936-2bce-4ce9-a61a-01b6502764fc%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.