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.
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.
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs