BigW Consortium Gitlab

Commit 571c832d by blackst0ne

Simplified assign_attributes for issuable

parent 7ad5a1b3
...@@ -216,15 +216,12 @@ class IssuableBaseService < BaseService ...@@ -216,15 +216,12 @@ class IssuableBaseService < BaseService
params[:label_ids] = label_ids if labels_changing?(issuable.label_ids, label_ids) params[:label_ids] = label_ids if labels_changing?(issuable.label_ids, label_ids)
if issuable.changed? || params.present? if issuable.changed? || params.present?
issuable.assign_attributes(params.merge(updated_by: current_user))
if has_title_or_description_changed?(issuable) if has_title_or_description_changed?(issuable)
issuable.assign_attributes(params.merge( issuable.assign_attributes(last_edited_at: Time.now, last_edited_by: current_user)
last_edited_at: Time.now,
last_edited_by: current_user
))
end end
issuable.assign_attributes(params.merge(updated_by: current_user))
before_update(issuable) before_update(issuable)
if issuable.with_transaction_returning_status { issuable.save } if issuable.with_transaction_returning_status { issuable.save }
......
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