Project

General

Profile

Patch #39847 ยป cache-journal-attachments.patch

Go MAEDA, 2023-12-14 12:09

View differences:

app/models/journal.rb
end
def attachments
ids = details.select {|d| d.property == 'attachment' && d.value.present?}.map(&:prop_key)
Attachment.where(id: ids).sort_by {|a| ids.index(a.id.to_s)}
@attachments ||= begin
ids = details.select {|d| d.property == 'attachment' && d.value.present?}.map(&:prop_key)
ids.empty? ? [] : Attachment.where(id: ids).sort_by {|a| ids.index(a.id.to_s)}
end
end
def visible?(*args)
    (1-1/1)