summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-04-15 15:52:12 +0000
committerLin Jen-Shin <godfat@godfat.org>2019-04-15 15:52:12 +0000
commit57cdf56aa7df41b013d9c47c6b12bf5a9e20e4f4 (patch)
treeaa4e6e8aa09f2bc845cd36a7abcd7cb00b694c64 /lib
parentfcb70d9bbbc14dc695fa87dc1dea5fa7fe78f6d2 (diff)
parent650f40865e5d8136cb366fbde689c4100aafb0c5 (diff)
downloadgitlab-ce-57cdf56aa7df41b013d9c47c6b12bf5a9e20e4f4.tar.gz
Merge branch 'forbid-the-usage-of-reload' into 'master'
Forbid the usage of reload Closes #60218 See merge request gitlab-org/gitlab-ce!27125
Diffstat (limited to 'lib')
-rw-r--r--lib/api/pipelines.rb2
-rw-r--r--lib/api/projects.rb6
-rw-r--r--lib/gitlab/optimistic_locking.rb2
-rw-r--r--lib/tasks/gitlab/update_templates.rake2
4 files changed, 6 insertions, 6 deletions
diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb
index f29a18e94cf..667bf1ec801 100644
--- a/lib/api/pipelines.rb
+++ b/lib/api/pipelines.rb
@@ -137,7 +137,7 @@ module API
pipeline.cancel_running
status 200
- present pipeline.reload, with: Entities::Pipeline
+ present pipeline.reset, with: Entities::Pipeline
end
end
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 57336e95041..cb0106592f5 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -351,7 +351,7 @@ module API
not_modified!
else
current_user.toggle_star(user_project)
- user_project.reload
+ user_project.reset
present user_project, with: Entities::Project, current_user: current_user
end
@@ -363,7 +363,7 @@ module API
post ':id/unstar' do
if current_user.starred?(user_project)
current_user.toggle_star(user_project)
- user_project.reload
+ user_project.reset
present user_project, with: Entities::Project, current_user: current_user
else
@@ -403,7 +403,7 @@ module API
result = ::Projects::ForkService.new(fork_from_project, current_user).execute(user_project)
if result
- present user_project.reload, with: Entities::Project, current_user: current_user
+ present user_project.reset, with: Entities::Project, current_user: current_user
else
render_api_error!("Project already forked", 409) if user_project.forked?
end
diff --git a/lib/gitlab/optimistic_locking.rb b/lib/gitlab/optimistic_locking.rb
index ce4ba9f752b..868b2ae641a 100644
--- a/lib/gitlab/optimistic_locking.rb
+++ b/lib/gitlab/optimistic_locking.rb
@@ -12,7 +12,7 @@ module Gitlab
retries -= 1
raise unless retries >= 0
- subject.reload
+ subject.reset
retry
end
diff --git a/lib/tasks/gitlab/update_templates.rake b/lib/tasks/gitlab/update_templates.rake
index abe10f5580e..e058e9fe069 100644
--- a/lib/tasks/gitlab/update_templates.rake
+++ b/lib/tasks/gitlab/update_templates.rake
@@ -50,7 +50,7 @@ namespace :gitlab do
puts "Waiting for the import to finish"
sleep(5)
- project.reload
+ project.reset
end
Projects::ImportExport::ExportService.new(project, admin).execute