Created
June 7, 2009 15:20
-
-
Save collin/125371 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
| def before_password_verification method_sym, options={}, &block | |
| puts "Called before_password_verification: #{method_sym}, #{options.inspect}" | |
| if block_given? | |
| before :before_password_verification, method_sym, &block | |
| else | |
| before :before_password_verification do | |
| if options[:if] | |
| return false unless send(options[:if]) | |
| end | |
| if options[:unless] | |
| return false if send(options[:unless]) | |
| end | |
| send method_sym | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment