fixes user duplication [fixes SCI-344]

This commit is contained in:
zmagod 2016-08-18 11:26:52 +02:00
parent 6879521a75
commit da2b9ccf82

View file

@ -93,7 +93,7 @@ class Project < ActiveRecord::Base
.joins("INNER JOIN user_organizations ON users.id = user_organizations.user_id ")
.where("user_organizations.organization_id = ?", organization)
.where.not(confirmed_at: nil)
.where("users.id NOT IN (?)", UserProject.where(project: self).select(:id).distinct)
.where("users.id NOT IN (?)", UserProject.where(project: self).select(:user_id).distinct)
end
def user_role(user)