Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mshahzadtariq/trackstamps
Track which user created or updated record in rails. This gem depends on devise gem and uses devise 'current_user' helper method.
https://github.com/mshahzadtariq/trackstamps
devise gem ruby ruby-on-rails
Last synced: about 5 hours ago
JSON representation
Track which user created or updated record in rails. This gem depends on devise gem and uses devise 'current_user' helper method.
- Host: GitHub
- URL: https://github.com/mshahzadtariq/trackstamps
- Owner: mshahzadtariq
- License: mit
- Created: 2015-05-28T15:39:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-16T14:27:32.000Z (over 1 year ago)
- Last Synced: 2024-09-13T17:13:08.914Z (11 days ago)
- Topics: devise, gem, ruby, ruby-on-rails
- Language: Ruby
- Homepage:
- Size: 139 KB
- Stars: 10
- Watchers: 4
- Forks: 5
- Open Issues: 10
-
Metadata Files:
- Readme: README.rdoc
- License: MIT-LICENSE
Awesome Lists containing this project
README
= Trackstamps
Track which user created or updated record in rails. This gem depends on devise gem and uses devise 'current_user' helper method.
== Dependency
This gem depends on devise gem and uses devise 'current_user' helper method.
== Installation
Simply add trackstamps gem to your Gemfile.
gem 'trackstamps'
Install bundler gems
bundle install
Install trackstamps
rails generate trackstamps:install
Generate migration on required model's table
rails generate trackstamps:migration table_name
i.e. if you need to track changes on Account model, you need to do this
rails generate trackstamps:migration accounts
It will automatically include trackstamps module inside your model class
class Account < ActiveRecord::Base
include Trackstamps.....
end
Execute migrations
rake db:migrate
And now you are ready to track changes
== Usage
It will automatically track record is created or updated by which user. i.e.
Account.last.creator
will return last account was created by which user. Similarily
Account.find(8).updater
will tells us which user updated account with id 8
== TODO
* Autodiscover devise model class
* Mongoid ORM support== Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request