summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-09-04 16:12:35 +0200
committerKamil Trzciński <ayufan@ayufan.eu>2018-09-04 16:28:40 +0200
commitc899ee585ba5f18ab5bfcbf9c57e4025c14aa137 (patch)
tree8cd41b43e7f04e75dbf4f33954c893534a2055cc
parent8008f1231573eca507d9ddb77328d9b3a9ee566b (diff)
downloadgitlab-ce-c899ee585ba5f18ab5bfcbf9c57e4025c14aa137.tar.gz
Fix complementary logic
-rw-r--r--app/models/ci/build.rb12
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