Module: Sequel::Plugins::Auditer::InstanceMethods

Defined in:
lib/sequel/plugins/auditer.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)



261
262
263
264
# File 'lib/sequel/plugins/auditer.rb', line 261

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)



275
276
277
278
# File 'lib/sequel/plugins/auditer.rb', line 275

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