Class: EgovUtils::RefreshUserGroups

Inherits:
Object
  • Object
show all
Defined in:
app/services/egov_utils/refresh_user_groups.rb

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ RefreshUserGroups

Returns a new instance of RefreshUserGroups.



4
5
6
# File 'app/services/egov_utils/refresh_user_groups.rb', line 4

def initialize(user)
  @user = user
end

Instance Method Details

#callObject



8
9
10
11
12
# File 'app/services/egov_utils/refresh_user_groups.rb', line 8

def call
  group_ids = (current_non_ldap_groups + ldap_groups).compact.map(&:id)
  user.group_ids = group_ids
  user
end