Module | CollectiveIdea::Acts::Audited::SingletonMethods |
In: |
lib/acts_as_audited.rb
|
Returns an array of columns that are audited. See non_audited_columns
# File lib/acts_as_audited.rb, line 242 242: def audited_columns 243: self.columns.select { |c| !non_audited_columns.include?(c.name) } 244: end
# File lib/acts_as_audited.rb, line 258 258: def disable_auditing 259: write_inheritable_attribute :auditing_enabled, false 260: end
# File lib/acts_as_audited.rb, line 262 262: def enable_auditing 263: write_inheritable_attribute :auditing_enabled, true 264: end
Executes the block with auditing disabled.
Foo.without_auditing do @foo.save end
# File lib/acts_as_audited.rb, line 252 252: def without_auditing(&block) 253: auditing_was_enabled = auditing_enabled 254: disable_auditing 255: returning(block.call) { enable_auditing if auditing_was_enabled } 256: end