Class: AuditLog
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- AuditLog
- Defined in:
- lib/sequel/plugins/audited.rb
Instance Method Summary collapse
-
#audit_user ⇒ Object
Obtains the
current_userbased upon the ‘:audited_current_user_method’ value set in the audited model, either via defaults or via :user_method config options. - #before_validation ⇒ Object
Instance Method Details
#audit_user ⇒ Object
Obtains the current_user based upon the ‘:audited_current_user_method’ value set in the audited model, either via defaults or via :user_method config options
# NOTE! this allows overriding the default value on a per audited model
29 30 31 32 |
# File 'lib/sequel/plugins/audited.rb', line 29 def audit_user m = Kernel.const_get(associated_type) m.send(m.audited_current_user_method) || send(m.audited_current_user_method) end |
#before_validation ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/sequel/plugins/audited.rb', line 14 def before_validation # grab the current user if u = audit_user self.modifier = u end super end |