module Admin
  class ApplicationController < ::ApplicationController
    before_action :setup_administrator!
    load_and_authorize_resource
    layout 'cmtool/application'
    private

    def setup_administrator!
      authenticate_administrator!
      @current_ability = Admin::Ability.new current_administrator
      run_after_authentication_hooks!
    end

    def set_locale
      I18n.locale = :en
    end
  end
end
