Created
February 16, 2016 01:12
-
-
Save armandofox/f8850b42163f914d3e4e to your computer and use it in GitHub Desktop.
around_filter_example.rb
This file contains 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
# somewhat contrived example of an around-filter | |
around_filter :only => ['withdraw_money', 'transfer_money'] do | |
# log who is trying to move money around | |
start = Time.now | |
yield # do the action | |
# note how long it took | |
logger.info params | |
logger.info (Time.now - start) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment