The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
546 B

  1. class ApplicationController < ActionController::Base
  2. # Prevent CSRF attacks by raising an exception.
  3. # For APIs, you may want to use :null_session instead.
  4. protect_from_forgery with: :exception
  5. force_ssl if: "Rails.env.production? && ENV['LOCAL_HTTPS'] == 'true'"
  6. # Profiling
  7. before_action do
  8. if (current_user && current_user.admin?) || Rails.env.development?
  9. Rack::MiniProfiler.authorize_request
  10. end
  11. end
  12. helper_method :current_account
  13. protected
  14. def current_account
  15. current_user.try(:account)
  16. end
  17. end