Sha256: da11e9f5d3fea268e1f59b9e20aa7f4dbf567fc23a0f4183820efd8c6bc842cc

Contents?: true

Size: 411 Bytes

Versions: 4

Compression:

Stored size: 411 Bytes

Contents

class Admin::BaseController < ActionController::Base
  include Pagy::Backend

  before_action :set_time_zone
  before_action :authenticate

  private
    def set_time_zone
      Time.zone = cookies[:time_zone]
    end

    def authenticate
      if user = Admin::User.find_by_id(session[:admin_user_id])
        Admin::Current.user = user
      else
        redirect_to admin_sign_in_path
      end
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
administration-zero-1.0.2 lib/generators/admin/install/templates/controllers/admin/base_controller.rb
administration-zero-1.0.1 lib/generators/admin/install/templates/controllers/admin/base_controller.rb
administration-zero-1.0.0 lib/generators/admin/install/templates/controllers/admin/base_controller.rb
administration-zero-0.0.18 lib/generators/admin/install/templates/controllers/admin/base_controller.rb