Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
infused committed Oct 19, 2008
1 parent 7f1a563 commit b8a1a7a
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,30 @@ Blame

Automatically userstamps create and update operations if the table has fields named created_by and/or updated_by.

Blame adds a `userstamps` migration helper which will create both created_by and updated_by columns to your table:

create_table :widgets do |t|
t.string :name
t.timestamps
t.userstamps
end

Blame defaults to looking for the current user in User.current_user, but you can override this behavior by writing your own userstamp_object method in ActiveRecord::Base or any of your models:

def userstamp_object
User.current_user # the default
Superduper.superman
end
def userstamp_object
User.current_user # the default
Superduper.superman
end

Automatic userstamping can be turned off by setting
<tt>ActiveRecord::Base.record_userstamps = false</tt>

ActiveRecord::Base.record_userstamps = false


Installation
============

ruby script/plugin install git://github.com/infused/blame.git


Credit
Expand Down

0 comments on commit b8a1a7a

Please sign in to comment.