-
redacted - Changes to these fields will be logged, but the values will not. This is useful, for example, if you wish to audit when a password is changed, without saving the actual password in the log. To store values as something other than ‘[REDACTED]’, pass an argument to the redaction_value option.
class User < ActiveRecord::Base
audited redacted: :password, redaction_value: SecureRandom.uuid
end
-
if - Only audit the model when the given function returns true
-
unless - Only audit the model when the given function returns false
class User < ActiveRecord::Base
audited :if => :active?
def active?
self.status == 'active'
end
end
-
redact_after_destroy - If an array is passed, the columns in the array will be redacted from audits when the record is destroyed.
class User < ActiveRecord::Base
audited redact_after_destroy: [:name, :email, :address]
end