Sha256: a6fa389ec6aeb2fba07088f74f4d85cced17cfb37a5f4a5fe599dff3066960bc

Contents?: true

Size: 645 Bytes

Versions: 1

Compression:

Stored size: 645 Bytes

Contents

module Alchemy
  module AuthenticationHelpers

    def self.included(base)
      base.send :helper_method, :current_user
      base.send :alias_method, :current_alchemy_user, :current_user
    end

    def current_user
      return @current_user if defined?(@current_user)
      @current_user = current_user_session && current_user_session.record
    end

    def current_user_session
      return @current_user_session if defined?(@current_user_session)
      @current_user_session = UserSession.find
    end

    def logged_in?
      !current_user.blank?
    end

  end
end

ApplicationController.send :include, Alchemy::AuthenticationHelpers

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alchemy_cms-2.2.rc13 lib/alchemy/authentication_helpers.rb