Skip to content

Instantly share code, notes, and snippets.

@braidn
Created November 14, 2013 17:36
Show Gist options
  • Save braidn/7470961 to your computer and use it in GitHub Desktop.
Save braidn/7470961 to your computer and use it in GitHub Desktop.
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