summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-11-27 16:27:36 +0000
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-11-28 10:01:00 +0000
commitbad26e2dab81239f3cb2e7e3ea76ba113415638c (patch)
tree5142b7570febe8ceb2733f0244f27a13e55081df
parent4bd8a427d4e8127f1badc7365b35702472918956 (diff)
downloadgitlab-ce-50341-cleanup-useless-project-import-attributes.tar.gz
Small code refactoring for condition circuit breaking50341-cleanup-useless-project-import-attributes
Also adds Changelog entry
-rw-r--r--app/controllers/projects/imports_controller.rb2
-rw-r--r--app/models/project_import_state.rb2
-rw-r--r--changelogs/unreleased/50341-cleanup-useless-project-import-attributes.yml6
3 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/projects/imports_controller.rb b/app/controllers/projects/imports_controller.rb
index 641f45b3b56..a10e159ea1e 100644
--- a/app/controllers/projects/imports_controller.rb
+++ b/app/controllers/projects/imports_controller.rb
@@ -22,7 +22,7 @@ class Projects::ImportsController < Projects::ApplicationController
def show
if @project.import_finished?
- if continue_params && continue_params[:to]
+ if continue_params&.key?(:to)
redirect_to continue_params[:to], notice: continue_params[:notice]
else
redirect_to project_path(@project), notice: finished_notice
diff --git a/app/models/project_import_state.rb b/app/models/project_import_state.rb
index c80e612053c..488f0cb5971 100644
--- a/app/models/project_import_state.rb
+++ b/app/models/project_import_state.rb
@@ -73,7 +73,7 @@ class ProjectImportState < ActiveRecord::Base
alias_method :no_import?, :none?
def in_progress?
- started? || scheduled?
+ scheduled? || started?
end
def started?
diff --git a/changelogs/unreleased/50341-cleanup-useless-project-import-attributes.yml b/changelogs/unreleased/50341-cleanup-useless-project-import-attributes.yml
new file mode 100644
index 00000000000..3893f14e15c
--- /dev/null
+++ b/changelogs/unreleased/50341-cleanup-useless-project-import-attributes.yml
@@ -0,0 +1,6 @@
+---
+title: Removes all the irrelevant code and columns that were migrated from the Project
+ table over to the ProjectImportState table
+merge_request: 21497
+author:
+type: performance