ActiverecordTouchy
Extend AR to use touch for has_many and has_one relations
Installation
Add this line to your application's Gemfile:
gem 'activerecord_touchy'And then execute:
$ bundle
Or install it yourself as:
$ gem install activerecord_touchy
Usage
Setup
class User < ActiveRecord::Base
has_many :articles, touch: true
has_one :profile, touch: true
endAfter changing user object relations articles and profile will be touched.
Associations are required updated_at column.
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