diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-31 00:07:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-31 00:07:00 +0000 |
commit | fd0691c6c0dc16ddada016af08c47a28614e888d (patch) | |
tree | 17e3da2d636967070bbd7b2039d3a5ce1adf1770 /app/models/project.rb | |
parent | 0f0a8be306e7e0cd5693f57414de351808c41db9 (diff) | |
download | gitlab-ce-fd0691c6c0dc16ddada016af08c47a28614e888d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 21 |
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 |