Class: AuditLoggable::ChangeSet::Base
- Inherits:
-
Object
- Object
- AuditLoggable::ChangeSet::Base
- Defined in:
- lib/audit_loggable/change_set.rb
Instance Method Summary collapse
-
#initialize(model, changes_method:, ignored_attributes: [], redacted_attributes: []) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(model, changes_method:, ignored_attributes: [], redacted_attributes: []) ⇒ Base
Returns a new instance of Base.
69 70 71 72 73 74 75 76 77 |
# File 'lib/audit_loggable/change_set.rb', line 69 def initialize(model, changes_method:, ignored_attributes: [], redacted_attributes: []) klass = model.class @changes = model .public_send(changes_method) .yield_self { |changes| AttributesFilter.new(klass, ignored_attributes, changes).call } .yield_self { |changes| EnumAttributesNormalizer.new(klass, changes).call } .yield_self { |changes| AttributesRedactor.new(redacted_attributes, changes).call } end |