class AuditLoggable::ChangeSet::Base

Attributes

changes[R]

Public Class Methods

new(model, changes_method:, ignored_attributes: [], redacted_attributes: []) click to toggle source
# 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