[#345] remove deprecated scoped
This commit is contained in:
parent
8173bce392
commit
1a97bfb67c
|
@ -2,7 +2,7 @@ class AddSaveToRepositoryToBuildLists < ActiveRecord::Migration
|
|||
def self.up
|
||||
add_column :build_lists, :save_to_repository_id, :integer
|
||||
|
||||
BuildList.scoped.includes(project: :repositories, save_to_platform: :repositories).find_in_batches do |batch|
|
||||
BuildList.includes(project: :repositories, save_to_platform: :repositories).find_in_batches do |batch|
|
||||
batch.each do |bl|
|
||||
begin
|
||||
project = bl.project
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace :hook do
|
|||
task install: :environment do
|
||||
hook = "/home/#{APP_CONFIG['shell_user']}/gitlab-shell/hooks/post-receive"
|
||||
say "Install process.."
|
||||
count, projects = 0, Project.scoped
|
||||
count, projects = 0, Project.all
|
||||
projects = projects.where(id: ENV['PROJECT_ID']) if ENV['PROJECT_ID']
|
||||
projects.each do |project|
|
||||
next unless Dir.exist? project.path
|
||||
|
@ -24,7 +24,7 @@ namespace :hook do
|
|||
desc "remove git hook from all repos"
|
||||
task remove: :environment do
|
||||
say "process.."
|
||||
count, projects = 0, Project.scoped
|
||||
count, projects = 0, Project.all
|
||||
projects = projects.where(id: ENV['PROJECT_ID']) if ENV['PROJECT_ID']
|
||||
projects.each do |project|
|
||||
FileUtils.rm_rf File.join(project.path, 'hooks', 'post-receive')
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace :project do
|
|||
namespace :maintainer do
|
||||
desc 'Set maintainer to owner (or to owners owner if owner is a group) to projects'
|
||||
task set_to_owner: :environment do
|
||||
projects = Project.scoped
|
||||
projects = Project.all
|
||||
count = projects.count
|
||||
say "Setting maintainer to all projects (#{count})"
|
||||
percent_per_batch = 100 * 1000 / count
|
||||
|
|
Loading…
Reference in New Issue