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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With