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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-31 03:07:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-31 03:07:00 +0300
commitfd0691c6c0dc16ddada016af08c47a28614e888d (patch)
tree17e3da2d636967070bbd7b2039d3a5ce1adf1770 /app/models
parent0f0a8be306e7e0cd5693f57414de351808c41db9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 16317b5827a..245d29554a3 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1966,27 +1966,6 @@ class Project < ApplicationRecord
(auto_devops || build_auto_devops)&.predefined_variables
end
- def append_or_update_attribute(name, value)
- if Project.reflect_on_association(name).try(:macro) == :has_many
- # if this is 1-to-N relation, update the parent object
- value.each do |item|
- item.update!(
- Project.reflect_on_association(name).foreign_key => id)
- end
-
- # force to drop relation cache
- public_send(name).reset # rubocop:disable GitlabSecurity/PublicSend
-
- # succeeded
- true
- else
- # if this is another relation or attribute, update just object
- update_attribute(name, value)
- end
- rescue ActiveRecord::RecordInvalid => e
- raise e, "Failed to set #{name}: #{e.message}"
- end
-
# Tries to set repository as read_only, checking for existing Git transfers in progress beforehand
#
# @return [Boolean] true when set to read_only or false when an existing git transfer is in progress