Inspect Previous Changes To ActiveRecord Object
book.title = "The Fifth Season"
book.changed? #=> true
book.title_changed? #=> true
book.publication_year_changed? #=> false
book.changes
#=> { "title" => ["Original Title", "The Fifth Season"] }book.title = "The Fifth Season"
book.save
book.title_previously_changed? #=> true
book.previous_changes
#=> { "title" => ["Original Title", "The Fifth Season"] }PreviousInclude Devise Helpers In Your Controller TestsNextLink To The Current Page With Query Params
Last updated