dirty_delta
Installation
Add the gem to your Gemfile.
gem "dirty_delta", github: "micahroberson/dirty_delta"
Run bundler. bundle install
Usage
In your model, add a single line.
class Timecard < ActiveRecord::Base
acts_as_dirty_delta
end
Access delta's by the attribute methods.
t = Timecard.create(hours: 8)
t.hours = 10
t.hours_delta == 2
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request