Commit a72ce8ca authored by nmilojevic1's avatar nmilojevic1

Replace assign_attributes with public_sent

parent b17f8920
...@@ -134,11 +134,11 @@ module Gitlab ...@@ -134,11 +134,11 @@ module Gitlab
return object unless value return object unless value
references.each do |key| references.each do |key|
attribute = key.delete_suffix('_id').to_sym attribute = "#{key.delete_suffix('_id')}=".to_sym
next unless object.respond_to?(key) && object.respond_to?(attribute) next unless object.respond_to?(key) && object.respond_to?(attribute)
if object.read_attribute(key) == value&.id if object.read_attribute(key) == value&.id
object.assign_attributes(attribute => value) object.public_send(attribute, value) # rubocop:disable GitlabSecurity/PublicSend
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment