Skip to content

Commit

Permalink
Ensure the core tests pass with Redmine 4.2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
nanego committed Jun 20, 2024
1 parent 9f1e093 commit bbd69a9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/redmine_comments/journal_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ def journal_attachments
end

def standard_attachments_method
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)}
if Redmine::VERSION::MAJOR >= 5
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)}
else
journalized.respond_to?(:attachments) ? journalized.attachments : []
end
end

# Returns a SQL condition to filter out journals with notes that are not visible to user
Expand Down

0 comments on commit bbd69a9

Please sign in to comment.