Class: AuditModel::Models::Base

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/audit_model/models/base.rb

Constant Summary collapse

BLACK_LIST =
[
  "id", 
  "created_at", 
  "updated_at"
]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(model, type) ⇒ Object



18
19
20
21
22
23
# File 'lib/audit_model/models/base.rb', line 18

def build(model, type)
  return if type == :update && !any_change?(model)
  attrs = sanitize(model, type)
  attrs[:rev_type] = type
  new(attrs)
end

Instance Method Details

#whoObject



13
14
15
# File 'lib/audit_model/models/base.rb', line 13

def who
  revision.user
end