Sha256: 086d2beb910874380e52e7c89eaadb090eff5781e65d844e6db0af9f739ea123

Contents?: true

Size: 665 Bytes

Versions: 13

Compression:

Stored size: 665 Bytes

Contents

module Authpds
  module Controllers
    module AuthpdsController
      module CoreAttributes
        # Set helper methods when this module is included.
        def self.included(klass)
          klass.class_eval do
            helper_method :current_user_session, :current_user
          end
        end

        # Get the current UserSession if it exists
        def current_user_session
          @current_user_session ||= UserSession.find
        end

        # Get the current User if there is a UserSession
        def current_user
          @current_user ||= current_user_session.record unless current_user_session.nil?
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
authpds-1.1.2 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-1.1.1 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-1.1.0 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-1.0.0 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-0.2.9 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-0.2.8 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-0.2.7 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-0.2.6 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-0.2.5 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-0.2.4 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-0.2.3 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-0.2.2 lib/authpds/controllers/authpds_controller/core_attributes.rb
authpds-0.2.1 lib/authpds/controllers/authpds_controller/core_attributes.rb