accessing the changed? method for an overridden attribute
11 views
Skip to first unread message
tonypm
unread,
Aug 9, 2013, 1:04:54 PM8/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
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.
tonypm
unread,
Aug 10, 2013, 2:48:30 AM8/10/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
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.