Module: Sorcery::Controller::Submodules::ActivityLogging::InstanceMethods

Defined in:
lib/sorcery/controller/submodules/activity_logging.rb

Instance Method Summary collapse

Instance Method Details

#current_usersObject

Returns an array of the active users.



21
22
23
24
25
26
27
28
29
# File 'lib/sorcery/controller/submodules/activity_logging.rb', line 21

def current_users
  Config.user_class.current_users
  # A possible patch here:
  # we'll add the current_user to the users list if he's not in it (can happen when he was inactive for more than activity timeout):
  #
  #   users.unshift!(current_user) if logged_in? && users.find {|u| u.id == current_user.id}.nil?
  #
  # disadvantages: can hurt performance.
end