Created
January 13, 2015 16:49
-
-
Save sirupsen/f3111d7f12f9d736d68a 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 load_customer | |
if customer_id = session[:customer_id] | |
@customer = Customer.find_by_id(session[:customer_id]) | |
end | |
# in reality e.g. a redis exception thrown from the driver | |
# could be raised from circuit breaker or semian as well (see later) | |
rescue Sessions::DataStoreUnavailable | |
flash[:notice] = 'Customer sign in is currently unavailable' | |
@customer = nil | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment