Is there a way to get the current variable? lets say that i have a "title" attribute in a method and i want to check in with the old value of the variable ?
how could i accomplish this ?
Is there a way to get the current variable? lets say that i have a "title" attribute in a method and i want to check in with the old value of the variable ?
how could i accomplish this ?
ActiveRecord provides a whole set of methods which work on "Dirty" attributes.
In your case, you can call title_was
to get the most recently saved version of that variable