Skip to content

Commit

Permalink
Fixed issue with adding roles (#1051)
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad authored Mar 20, 2020
1 parent bf04743 commit a825267
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/concerns/rolify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def update_roles(roles)
return true unless current_user.highest_priority_role.get_permission("can_manage_users")

new_roles = roles.split(' ').map(&:to_i)
old_roles = @user.roles.distinct.pluck(:id)
old_roles = @user.roles.pluck(:id).uniq

added_role_ids = new_roles - old_roles
removed_role_ids = old_roles - new_roles
Expand Down

1 comment on commit a825267

@bvdlingen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, works for me!

Please sign in to comment.