]> source.dussan.org Git - redmine.git/commitdiff
Allow Journal to return empty Array instead nil in Journal#attachments (#24308).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 18 Nov 2016 08:41:56 +0000 (08:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 18 Nov 2016 08:41:56 +0000 (08:41 +0000)
Patch by Roman Shipiev.

git-svn-id: http://svn.redmine.org/redmine/trunk@15957 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/journal.rb

index c43c4da9cacddcc69beec3703d5f93cc0c0fba87..3c15d978d21a88a241d11fe8bbfc42360bf46620 100644 (file)
@@ -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