Project

filthy

0.0
No commit activity in last 3 years
No release in over 3 years
Check if an attribute was changed after the last save.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

active_record
>= 0
active_support
>= 0
 Project Readme

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.