Sha256: 349edd65d6ba5f98abb4f4679972620a8474491c8d35dab3c8a7f8c08e75ba90

Contents?: true

Size: 419 Bytes

Versions: 3

Compression:

Stored size: 419 Bytes

Contents

module Authpds
  module Helpers
    module CurrentUserHelper
      # 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
        if current_user_session.present? 
          @current_user ||= current_user_session.record
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
authpds-1.1.5 lib/authpds/helpers/current_user_helper.rb
authpds-1.1.4 lib/authpds/helpers/current_user_helper.rb
authpds-1.1.3 lib/authpds/helpers/current_user_helper.rb