Sha256: ba4bebba83a47507e7a43d7b56f72ae050f14cdf5c95cc576398774bbcbe26ed

Contents?: true

Size: 460 Bytes

Versions: 5

Compression:

Stored size: 460 Bytes

Contents

# encoding: utf-8

module ConstructorCore
  class ApplicationController < ApplicationController
    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

5 entries across 5 versions & 1 rubygems

Version Path
constructor-core-0.5.4 app/controllers/constructor_core/application_controller.rb
constructor-core-0.5.3 app/controllers/constructor_core/application_controller.rb
constructor-core-0.5.2 app/controllers/constructor_core/application_controller.rb
constructor-core-0.5.1 app/controllers/constructor_core/application_controller.rb
constructor-core-0.5.0 app/controllers/constructor_core/application_controller.rb