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 --- lib/tasks/gitlab/cleanup.rake | 2 +- lib/tasks/gitlab/web_hook.rake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/tasks/gitlab/cleanup.rake b/lib/tasks/gitlab/cleanup.rake index 3c9802a0be4..d49cb6778f1 100644 --- a/lib/tasks/gitlab/cleanup.rake +++ b/lib/tasks/gitlab/cleanup.rake @@ -51,7 +51,7 @@ namespace :gitlab do git_base_path = Gitlab.config.gitlab_shell.repos_path all_dirs = Dir.glob(git_base_path + '/*') - global_projects = Project.where(namespace_id: nil).pluck(:path) + global_projects = Project.in_namespace(nil).pluck(:path) puts git_base_path.yellow puts "Looking for global repos to remove... " diff --git a/lib/tasks/gitlab/web_hook.rake b/lib/tasks/gitlab/web_hook.rake index f9f586db93c..412bcad1229 100644 --- a/lib/tasks/gitlab/web_hook.rake +++ b/lib/tasks/gitlab/web_hook.rake @@ -51,11 +51,11 @@ namespace :gitlab do if namespace_path.blank? Project elsif namespace_path == '/' - Project.where(namespace_id: nil) + Project.in_namespace(nil) else namespace = Namespace.where(path: namespace_path).first if namespace - Project.where(namespace_id: namespace.id) + Project.in_namespace(namespace.id) else puts "Namespace not found: #{namespace_path}".red exit 2 -- cgit v1.2.3