Module: Sequel::Plugins::Auditer::InstanceMethods
- Defined in:
- lib/sequel/plugins/auditer.rb
Instance Method Summary collapse
-
#blame ⇒ Object
(also: #last_audited_by)
Returns who put the post into its current state.
-
#last_audited_at ⇒ Object
(also: #last_audited_on)
Returns who put the post into its current state.
Instance Method Details
#blame ⇒ Object Also known as: last_audited_by
Returns who put the post into its current state.
post.blame # => 'joeblogs'
post.last_audited_by # => 'joeblogs'
Note! returns ‘not audited’ if there’s no audited version (new unsaved record)
240 241 242 243 |
# File 'lib/sequel/plugins/auditer.rb', line 240 def blame v = versions.last unless versions.empty? v ? v.modifier : 'not audited' end |
#last_audited_at ⇒ Object Also known as: last_audited_on
Returns who put the post into its current state.
post.last_audited_at # => '2015-12-19 @ 08:24:45'
post.last_audited_on # => 'joeblogs'
Note! returns ‘not audited’ if there’s no audited version (new unsaved record)
254 255 256 257 |
# File 'lib/sequel/plugins/auditer.rb', line 254 def last_audited_at v = versions.last unless versions.empty? v ? v.created_at : 'not audited' end |