Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jnunemaker/user_stamp
A Rails plugin that adds the ability to automatically stamp each record with the currently logged in user.
https://github.com/jnunemaker/user_stamp
Last synced: 18 days ago
JSON representation
A Rails plugin that adds the ability to automatically stamp each record with the currently logged in user.
- Host: GitHub
- URL: https://github.com/jnunemaker/user_stamp
- Owner: jnunemaker
- License: mit
- Created: 2008-10-17T15:14:35.000Z (about 16 years ago)
- Default Branch: master
- Last Pushed: 2010-06-07T01:27:15.000Z (over 14 years ago)
- Last Synced: 2024-10-17T02:26:12.331Z (23 days ago)
- Language: Ruby
- Homepage:
- Size: 329 KB
- Stars: 84
- Watchers: 3
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README
- License: MIT-LICENSE
Awesome Lists containing this project
README
= UserStamp
Rails plugin that makes stamping records with a user when they are
created and updated dirt simple. It assumes that your controller has
a current_user method. It also assumes that any record being stamped
has two attributes--creator_id and updater_id. You can override both
of these assumptions easily.== Setup
1. script/plugin install git://github.com/jnunemaker/user_stamp.git
2. Add user_stamp to application.rb, like the following:
class ApplicationController < ActionController::Base
user_stamp Post, Asset, Job
end== Defaults
UserStamp.creator_attribute = :creator_id
UserStamp.updater_attribute = :updater_id
UserStamp.current_user_method = :current_userIf your user stamped columns and current_user method are different,
just create an initializer such as config/initializers/user_stamp.rb
and copy and paste the defaults above, changing them to fit your app.== Problems?
Use the issue tracker on Github.
== Docs
http://rdoc.info/projects/jnunemaker/user_stamp
Copyright (c) 2008 [John Nunemaker], released under the MIT license