Module: Sequel::Plugins::Audited::InstanceMethods

Defined in:
lib/sequel/plugins/audited.rb

Instance Method Summary collapse

Instance Method Details

#blameObject 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)



231
232
233
234
# File 'lib/sequel/plugins/audited.rb', line 231

def blame
  v = versions.last unless versions.empty?
  v ? v.modifier : 'not audited'
end

#last_audited_atObject 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)



245
246
247
248
# File 'lib/sequel/plugins/audited.rb', line 245

def last_audited_at
  v = versions.last unless versions.empty?
  v ? v.created_at : 'not audited'
end