title: Is before_action/filter in application_controller.rb a bad practice?
body: <p>Consider the following</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
    # Prevent CSRF attacks by raising an exception.
    # For APIs, you may want to use :null_session instead.
    protect_from_forgery with: :exception
  
    before_filter :maintenance_mode
  
  private
  
  def maintenance_mode
        @settings = Setting.first
        if @settings.maintenance
          if logged_in?
            if !current_user.admin?
              redirect_to maintenance_url
            end
          else
            redirect_to maintenance_url
          end
        end
  
  end
  </code></pre>
  
  <p>is there a performance issue or bad practice in general to use before_actions globally? So i created a maintenance mode, where if in the database there is a true value on the maintenance attribute(which will be checked on each request i assume), and its likely not the best way, so is there a workaround in that?</p>
  
  <p>I can imagine of a cron job/rake task checking every minute in a background process but what i really want to know is before_action a bad thing in general?</p>