Skip to content

sealabcore/filthy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, Philippe Huibonhoa, and Ben Somers.

BookRenter.com Logo

Copyright

Copyright (c) 2012 Mike Taylor, Bookrenter.com.

About

Check if an attribute was changed on the last save.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages