summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Mazetto <gabriel@gitlab.com>2017-01-12 18:27:06 -0500
committerGabriel Mazetto <gabriel@gitlab.com>2017-01-12 18:37:21 -0500
commite1521b748bc12f71fa7b8f311fcefb9bd3aca8ae (patch)
tree382901b31b20887f495e85c7c0813f2d82cceaf0
parente75b1f11057829964dd9c3aac3b0a0deb964707e (diff)
downloadgitlab-ce-bug/project-feature-compatibility.tar.gz
Mutate the attribute instead of issuing a write operation to the DBbug/project-feature-compatibility
This fixes gitlab-org/gitlab-ee#1520
-rw-r--r--app/models/concerns/project_features_compatibility.rb2
-rw-r--r--changelogs/unreleased/bug-project-feature-compatibility.yml5
2 files changed, 6 insertions, 1 deletions
diff --git a/app/models/concerns/project_features_compatibility.rb b/app/models/concerns/project_features_compatibility.rb
index 6d88951c713..60734bc6660 100644
--- a/app/models/concerns/project_features_compatibility.rb
+++ b/app/models/concerns/project_features_compatibility.rb
@@ -32,6 +32,6 @@ module ProjectFeaturesCompatibility
build_project_feature unless project_feature
access_level = Gitlab::Utils.to_boolean(value) ? ProjectFeature::ENABLED : ProjectFeature::DISABLED
- project_feature.update_attribute(field, access_level)
+ project_feature.send(:write_attribute, field, access_level)
end
end
diff --git a/changelogs/unreleased/bug-project-feature-compatibility.yml b/changelogs/unreleased/bug-project-feature-compatibility.yml
new file mode 100644
index 00000000000..2124ee085e0
--- /dev/null
+++ b/changelogs/unreleased/bug-project-feature-compatibility.yml
@@ -0,0 +1,5 @@
+---
+title: Mutate the attribute instead of issuing a write operation to the DB in `ProjectFeaturesCompatibility`
+ concern.
+merge_request: 8552
+author: