From: Jean-Philippe Lang Date: Fri, 18 Nov 2016 08:41:56 +0000 (+0000) Subject: Allow Journal to return empty Array instead nil in Journal#attachments (#24308). X-Git-Tag: 3.4.0~600 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fcbd06e09069160a31bb70d3514383fea1e2b7f0;p=redmine.git Allow Journal to return empty Array instead nil in Journal#attachments (#24308). Patch by Roman Shipiev. git-svn-id: http://svn.redmine.org/redmine/trunk@15957 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/journal.rb b/app/models/journal.rb index c43c4da9c..3c15d978d 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -125,7 +125,7 @@ class Journal < ActiveRecord::Base end def attachments - journalized.respond_to?(:attachments) ? journalized.attachments : nil + journalized.respond_to?(:attachments) ? journalized.attachments : [] end # Returns a string of css classes