Fix RecordNotFound error when deleting attachments

Using find_by instead of find.
This commit is contained in:
Iku Iwasa
2020-10-25 17:15:34 +09:00
parent 5623961366
commit e7e6539500

View File

@@ -240,7 +240,7 @@ class Messenger
when 'fixed_version'
value = object_field_value Version, detail.value
when 'attachment'
attachment = Attachment.find(detail.prop_key)
attachment = Attachment.find_by id: detail.prop_key
value = if attachment.present?
escape = false
"<#{object_url attachment}|#{markup_format attachment.filename}>"