mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-13 18:29:59 +01:00
Remove logic to append reasons to existing reports
This commit is contained in:
parent
b6503abdba
commit
5decee81b1
2 changed files with 0 additions and 10 deletions
|
@ -8,12 +8,4 @@ class Report < ApplicationRecord
|
|||
def target
|
||||
type.sub('Reports::', '').constantize.where(id: target_id).first
|
||||
end
|
||||
|
||||
def append_reason(new_reason)
|
||||
if reason.nil?
|
||||
update(reason: new_reason)
|
||||
else
|
||||
update(reason: [reason || "", new_reason].join("\n"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -159,8 +159,6 @@ class User < ApplicationRecord
|
|||
existing = Report.find_by(type: "Reports::#{object.class}", target_id: object.id, user_id: id, target_user_id: target_user&.id, resolved: false)
|
||||
if existing.nil?
|
||||
Report.create(type: "Reports::#{object.class}", target_id: object.id, user_id: id, target_user_id: target_user&.id, reason:)
|
||||
elsif !reason.nil? && reason.length.positive?
|
||||
existing.append_reason(reason)
|
||||
end
|
||||
end
|
||||
# endregion
|
||||
|
|
Loading…
Reference in a new issue