What the value was

Been programming with Rails for well over three years now, and only now had the need to know what an attribute was before you changed it.


2.2.0 :007 > c.first_name
=> "Nick"
2.2.0 :008 > c.first_name = 'Johnny'
=> "Johnny"
2.2.0 :009 > c.first_name_was
=> "Nick"

May be old hat for a lot of ya, but awesome when you get something for free.

Posted in Ruby on Rails

Leave a Reply

Your email address will not be published. Required fields are marked *

*