All audit operations during the block are recorded as being made by user. This is not model specific, the method is a convenience wrapper around @see Audit#as_user.
# File lib/audited/auditor.rb, line 265 def audit_as( user, &block ) Audited.audit_class.as_user( user, &block ) end
Returns an array of columns that are audited. See non_audited_columns
# File lib/audited/auditor.rb, line 237 def audited_columns self.columns.select { |c| !non_audited_columns.include?(c.name) } end
# File lib/audited/auditor.rb, line 253 def disable_auditing self.auditing_enabled = false end
# File lib/audited/auditor.rb, line 257 def enable_auditing self.auditing_enabled = true end
Executes the block with auditing disabled.
Foo.without_auditing do @foo.save end
# File lib/audited/auditor.rb, line 247 def without_auditing(&block) auditing_was_enabled = auditing_enabled disable_auditing block.call.tap { enable_auditing if auditing_was_enabled } end
Generated with the Darkfish Rdoc Generator 2.