Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-01-31 02:21:03 +0300
committerThong Kuah <tkuah@gitlab.com>2019-02-06 12:39:38 +0300
commit8ef1128f672266c789fc135500e1287ab389bb16 (patch)
tree64c843618e874d4b87e775a886d0d215f67c78c9 /app
parentbc5a2ed8c6548f6a46255ff82460cab8315e85ac (diff)
Update version column after application is updated
Note: updating version column after :updating is not ideal in the updating -> update_erroed case. This will mean that the application now records the version as the version that failed to upgrade, not the version that it is currently on.
Diffstat (limited to 'app')
-rw-r--r--app/models/clusters/concerns/application_version.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/clusters/concerns/application_version.rb b/app/models/clusters/concerns/application_version.rb
index ccad74dc35a..285c9d98935 100644
--- a/app/models/clusters/concerns/application_version.rb
+++ b/app/models/clusters/concerns/application_version.rb
@@ -10,6 +10,10 @@ module Clusters
after_transition any => [:installing] do |application|
application.update(version: application.class.const_get(:VERSION))
end
+
+ before_transition any => :updated do |application|
+ application.version = application.class.const_get(:VERSION)
+ end
end
end
end