0
0
Fork 0

Moving some counter queries out of subqueries in the API

This commit is contained in:
Eugen Rochko 2016-11-22 22:59:54 +01:00
parent 4b5b953d42
commit fc90d38893
9 changed files with 62 additions and 9 deletions

View file

@ -14,6 +14,7 @@ class ApplicationController < ActionController::Base
before_action :store_current_location, except: :raise_not_found, unless: :devise_controller?
before_action :set_locale
before_action :check_rack_mini_profiler
def raise_not_found
raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}"
@ -31,6 +32,10 @@ class ApplicationController < ActionController::Base
I18n.locale = I18n.default_locale
end
def check_rack_mini_profiler
Rack::MiniProfiler.authorize_request if current_user && current_user.admin?
end
protected
def not_found