Created
November 14, 2013 17:36
-
-
Save braidn/7470961 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
class ApplicationController < ActionController::Base | |
unless Rails.application.config.consider_all_requests_local | |
rescue_from ActionController::RoutingError, | |
ActionController::UnknownController, | |
::AbstractController::ActionNotFound, | |
ActiveRecord::RecordNotFound, | |
with: not_found | |
end | |
protect_from_forgery | |
before_filter :miniprofiler | |
private | |
def run_later(job) | |
Delayed::Job.enqueue(job) | |
end | |
def miniprofiler | |
return unless spree_current_user && spree_current_user.has_spree_role?(:admin) | |
Rack::MiniProfiler.authorize_request | |
end | |
def not_found | |
raise ActionController::RoutingError.new('Not Found') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment