if we also want to find groups, we need to send to the Principal model

pull/6827/head
Jens Ulferts 8 years ago committed by Oliver Günther
parent 9d326c487f
commit 399d7a16af
  1. 2
      app/helpers/my_projects_users_helper.rb

@ -30,7 +30,7 @@ module MyProjectsUsersHelper
LIMIT #{size} ) } LIMIT #{size} ) }
end.join(" UNION ALL ") end.join(" UNION ALL ")
User.find_by_sql(sql_string).group_by(&:role_id).inject({}) do |hash, (role_id, users)| Principal.find_by_sql(sql_string).group_by(&:role_id).inject({}) do |hash, (role_id, users)|
hash[all_roles.detect{ |r| r.id == role_id.to_i }] = users.uniq {|user| user.id} hash[all_roles.detect{ |r| r.id == role_id.to_i }] = users.uniq {|user| user.id}
hash hash
end end

Loading…
Cancel
Save