Commit bfd9855a authored by Yorick Peterse's avatar Yorick Peterse

Prefix table names for User UNIONs

parent 189c40c3
......@@ -396,13 +396,14 @@ class User < ActiveRecord::Base
union = Gitlab::SQL::Union.
new([groups.select(:id), authorized_projects.select(:namespace_id)])
Group.where("id IN (#{union.to_sql})")
Group.where("namespaces.id IN (#{union.to_sql})")
end
end
# Projects user has access to
def authorized_projects
@authorized_projects ||= Project.where("id IN (#{projects_union.to_sql})")
@authorized_projects ||=
Project.where("projects.id IN (#{projects_union.to_sql})")
end
def owned_projects
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment