Sha256: ee718fc20950957321ebc174225744b3964e5a10c2beced76861ddf35dfabab1

Contents?: true

Size: 521 Bytes

Versions: 16

Compression:

Stored size: 521 Bytes

Contents

# encoding: utf-8

module ConstructorCore
  class ApplicationController < ::ApplicationController
    before_filter :authenticate_user!, :except => [:show]

    helper_method :current_user

    private

    def authenticate_user!
      warden.authenticate!
    end

    def user_signed_in?
      !!current_user
    end

    def current_user
      @current_user ||= warden.authenticate
    end

    def user_session
      current_user && warden.session
    end

    def warden
      request.env['warden']
    end
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
constructor-pages-0.7.2 core/app/controllers/constructor_core/application_controller.rb
constructor-core-0.7.2 core/app/controllers/constructor_core/application_controller.rb
constructor-cms-0.7.2 core/app/controllers/constructor_core/application_controller.rb
constructor-core-0.7.1 core/app/controllers/constructor_core/application_controller.rb
constructor-core-0.7.0 app/controllers/constructor_core/application_controller.rb
constructor-cms-0.7.0 core/app/controllers/constructor_core/application_controller.rb
constructor-core-0.6.4 app/controllers/constructor_core/application_controller.rb
constructor-cms-0.6.4 core/app/controllers/constructor_core/application_controller.rb
constructor-core-0.6.3 app/controllers/constructor_core/application_controller.rb
constructor-cms-0.6.3 core/app/controllers/constructor_core/application_controller.rb
constructor-core-0.6.2 app/controllers/constructor_core/application_controller.rb
constructor-cms-0.6.2 core/app/controllers/constructor_core/application_controller.rb
constructor-core-0.6.1 app/controllers/constructor_core/application_controller.rb
constructor-cms-0.6.1 core/app/controllers/constructor_core/application_controller.rb
constructor-core-0.6.0 app/controllers/constructor_core/application_controller.rb
constructor-cms-0.6.0 core/app/controllers/constructor_core/application_controller.rb