diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-12 00:09:41 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-12 00:09:41 +0300 |
commit | c69ca9912ed06876d96e0bb1aa7d511473867dc2 (patch) | |
tree | 35544f45f283f408d3eb1e3fd5f8fcbd235df223 /lib | |
parent | 8f142c4aaeac73743196b1648677eb712f70c87b (diff) | |
parent | b0de6e9ae27a6364819f47d13d827a8aa253c83e (diff) |
Merge pull request #9371 from zenati/patch-2
An `in_namespace` scope is already present
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/gitlab/cleanup.rake | 2 | ||||
-rw-r--r-- | lib/tasks/gitlab/web_hook.rake | 4 |
2 files changed, 3 insertions, 3 deletions
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 |