Created
November 25, 2010 23:25
-
-
Save joho/716068 to your computer and use it in GitHub Desktop.
possibly the funniest controller before filters we have in our codebase
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
class AccountsController < ActionController::Base | |
before_filter :lock_out_annoying_scammers | |
def lock_out_annoying_scammers | |
if signed_in_user && signed_in_user.email =~ secret_hacker_regexp | |
logger.warn 'One of those annoying scammers has tried to access the accounts controller' | |
redirect_to 'http://www.amazon.com/Hackers-Jonny-Lee-Miller/dp/6305047456/' and return | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment