Created
October 12, 2011 22:02
-
-
Save tubbo/1282782 to your computer and use it in GitHub Desktop.
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
def confirm_current_user_account | |
case @customer_account.customer_type | |
when 'User' then | |
if @customer_account.customer == current_user | |
@customer = @customer_account | |
else | |
redirect_to bank_root_path, alert: "Error." | |
end | |
when 'Company' | |
unless current_user.companies.find(@customer_account.customer).nil? | |
@customer = @customer_account | |
else | |
redirect_to bank_root_path, alert: "Error." | |
end | |
else | |
redirect_to bank_root_path, alert: "Error." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment