|
|
@ -12,7 +12,6 @@ class ApplicationController < ActionController::Base |
|
|
|
rescue_from ActionController::RoutingError, with: :not_found |
|
|
|
rescue_from ActionController::RoutingError, with: :not_found |
|
|
|
rescue_from ActiveRecord::RecordNotFound, with: :not_found |
|
|
|
rescue_from ActiveRecord::RecordNotFound, with: :not_found |
|
|
|
rescue_from ActionController::InvalidAuthenticityToken, with: :unprocessable_entity |
|
|
|
rescue_from ActionController::InvalidAuthenticityToken, with: :unprocessable_entity |
|
|
|
rescue_from Rack::Timeout::RequestExpiryError, Rack::Timeout::RequestTimeoutError, with: :request_timeout |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
before_action :store_current_location, except: :raise_not_found, unless: :devise_controller? |
|
|
|
before_action :store_current_location, except: :raise_not_found, unless: :devise_controller? |
|
|
|
before_action :set_locale |
|
|
|
before_action :set_locale |
|
|
@ -70,13 +69,6 @@ class ApplicationController < ActionController::Base |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def request_timeout |
|
|
|
|
|
|
|
respond_to do |format| |
|
|
|
|
|
|
|
format.any { head 503 } |
|
|
|
|
|
|
|
format.html { render 'errors/503', layout: 'error', status: 503 } |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def current_account |
|
|
|
def current_account |
|
|
|
@current_account ||= current_user.try(:account) |
|
|
|
@current_account ||= current_user.try(:account) |
|
|
|
end |
|
|
|
end |
|
|
|