diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-01-31 02:59:26 +0300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-02-06 14:07:49 +0300 |
commit | e72f24d27be911ffce943929b7ca2f6df7051083 (patch) | |
tree | 65aecff19acc8b833f158f94e33d1771a45e721d /app/models/clusters | |
parent | 8ef1128f672266c789fc135500e1287ab389bb16 (diff) |
Update version on :installed, not :installing
This makes this consistent with :updated. And also avoids a potential
issue where an install errors which means that that the recorded version
won't necessarily reflect the version that is actually installed.
Diffstat (limited to 'app/models/clusters')
-rw-r--r-- | app/models/clusters/concerns/application_version.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/clusters/concerns/application_version.rb b/app/models/clusters/concerns/application_version.rb index 285c9d98935..e355de23df6 100644 --- a/app/models/clusters/concerns/application_version.rb +++ b/app/models/clusters/concerns/application_version.rb @@ -7,11 +7,7 @@ module Clusters included do state_machine :status do - after_transition any => [:installing] do |application| - application.update(version: application.class.const_get(:VERSION)) - end - - before_transition any => :updated do |application| + before_transition any => [:installed, :updated] do |application| application.version = application.class.const_get(:VERSION) end end |