From b0de6e9ae27a6364819f47d13d827a8aa253c83e Mon Sep 17 00:00:00 2001 From: zenati Date: Tue, 9 Jun 2015 13:28:11 +0200 Subject: An `in_namespace` scope is already present --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/project.rb') diff --git a/app/models/project.rb b/app/models/project.rb index 3c9f0dad28b..b161cbe86b9 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -158,7 +158,7 @@ class Project < ActiveRecord::Base scope :without_user, ->(user) { where('projects.id NOT IN (:ids)', ids: user.authorized_projects.map(&:id) ) } scope :without_team, ->(team) { team.projects.present? ? where('projects.id NOT IN (:ids)', ids: team.projects.map(&:id)) : scoped } scope :not_in_group, ->(group) { where('projects.id NOT IN (:ids)', ids: group.project_ids ) } - scope :in_namespace, ->(namespace) { where(namespace_id: namespace.id) } + scope :in_namespace, ->(namespace_ids) { where(namespace_id: namespace_ids) } scope :in_group_namespace, -> { joins(:group) } scope :personal, ->(user) { where(namespace_id: user.namespace_id) } scope :joined, ->(user) { where('namespace_id != ?', user.namespace_id) } -- cgit v1.2.1