Module: DataMapper::Userstamp
- Defined in:
- lib/dm-userstamp.rb
Defined Under Namespace
Modules: Stamper
Constant Summary collapse
- USERSTAMP_PROPERTIES =
{ :created_by_id => lambda { |r| r.created_by_id = userstamp_class.current_user.id if userstamp_class.current_user && r.new_record? && r.created_by_id.nil? }, :updated_by_id => lambda { |r| r.updated_by_id = userstamp_class.current_user.id if userstamp_class.current_user} }
Class Method Summary collapse
Class Method Details
.included(model) ⇒ Object
37 38 39 |
# File 'lib/dm-userstamp.rb', line 37 def self.included(model) model.before :save, :set_userstamp_properties end |
.userstamp_class ⇒ Object
28 29 30 |
# File 'lib/dm-userstamp.rb', line 28 def self.userstamp_class User end |