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.



38
39
40
41
42
43
44
45
46
47
# File 'lib/sorcery/controller/submodules/activity_logging.rb', line 38

def current_users
  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