Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 829 Bytes

README.rdoc

File metadata and controls

39 lines (25 loc) · 829 Bytes

Filthy

Rails gem to check if an attribute was changed on the last save. Useful in after_save callbacks.

Install

gem install filthy

Usage

class Movie < ActiveRecord::Base
  include Filthy

  filthy_attributes :title, :director

end

@movie = Movie.find(1)
@movie.title = "28 days later"
@movie.title_filthy?
=> false
@movie.save
=> true
@movie.title_filthy?
=> true
@movie.save
=> true
@movie.title_filthy?
=> false

Credits

Filthy is maintained by Mike Taylor and is funded by BookRenter.com. Many of the ideas that have inspired Filthy come from practical usage by the Bookrenter software development team and conversations with Bookrenter developers Andrew Wheeler, Michael Pearce, and Philippe Huibonhoa.

Copyright © 2012 Mike Taylor, Bookrenter.com.