diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-04 16:12:35 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-04 16:28:40 +0200 |
commit | c899ee585ba5f18ab5bfcbf9c57e4025c14aa137 (patch) | |
tree | 8cd41b43e7f04e75dbf4f33954c893534a2055cc | |
parent | 8008f1231573eca507d9ddb77328d9b3a9ee566b (diff) | |
download | gitlab-ce-c899ee585ba5f18ab5bfcbf9c57e4025c14aa137.tar.gz |
Fix complementary logic
-rw-r--r-- | app/models/ci/build.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index e4e162fcf61..8ffc4fa870d 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -544,12 +544,14 @@ module Ci end def options=(value) - if Feature.enabled?(:ci_use_build_metadata_for_config) + if Feature.enabled?(:ci_use_build_metadata_for_config) && false # save and remove from this model ensure_metadata.yaml_options = value write_attribute(:options, nil) else - super + # save and remove from metadata model + write_attribute(:options, nil) + metadata.json_options = nil if metadata end end @@ -560,12 +562,14 @@ module Ci end def yaml_variables=(value) - if Feature.enabled?(:ci_use_build_metadata_for_config) + if Feature.enabled?(:ci_use_build_metadata_for_config) && false # save and remove from this model ensure_metadata.json_variables = value write_attribute(:yaml_variables, nil) else - super + # save and remove from metadata model + write_attribute(:yaml_variables, nil) + metadata.json_variables = nil if metadata end end |