Created
October 22, 2009 20:08
-
-
Save jdunphy/216253 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Executes the block with auditing disabled. | |
# | |
# Foo.without_auditing do | |
# @foo.save | |
# end | |
# | |
def without_auditing(&block) | |
auditing_was_enabled = auditing_enabled | |
disable_auditing | |
returning(block.call) { enable_auditing if auditing_was_enabled } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment