Module: Trackzor
- Included in:
- ActiveRecord::Base
- Defined in:
- lib/trackzor.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Class Method Summary collapse
-
.as_user(user, &block) ⇒ Object
All X attribute changes where X_updated_by exists will be recorded as made by
user
. - .included(base) ⇒ Object
Class Method Details
.as_user(user, &block) ⇒ Object
All X attribute changes where X_updated_by exists will be recorded as made by user
.
143 144 145 146 147 148 149 |
# File 'lib/trackzor.rb', line 143 def self.as_user(user, &block) Thread.current[:trackzor_user] = user yield Thread.current[:trackzor_user] = nil end |
.included(base) ⇒ Object
2 3 4 |
# File 'lib/trackzor.rb', line 2 def self.included(base) base.extend ClassMethods end |