Skip to content

Instantly share code, notes, and snippets.

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