Return user only once.

This commit is contained in:
Martin Edenhofer 2016-08-30 15:01:51 +02:00
parent ef3b018293
commit 105fca030d

View file

@ -432,7 +432,7 @@ returns
end end
condition += 'roles_users.role_id IN (?)' condition += 'roles_users.role_id IN (?)'
} }
User.joins(:users_roles).where("(#{condition}) AND users.active = ?", *total_role_ids, true).order(:id) User.joins(:users_roles).where("(#{condition}) AND users.active = ?", *total_role_ids, true).distinct.order(:id)
end end
=begin =begin