Created
November 24, 2013 19:17
-
-
Save braidn/7631141 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 | |
include Spree::Core::ControllerHelpers::Common | |
protect_from_forgery | |
unless Rails.application.config.consider_all_requests_local | |
rescue_from ActiveRecord::RecordNotFound, | |
ActionController::RoutingError, | |
ActionController::UnknownController, | |
ActionController::UnknownAction, | |
ActionController::MethodNotAllowed do |exception| | |
render_404_with_custom(exception) | |
end | |
end | |
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 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment