]> source.dussan.org Git - redmine.git/commitdiff
Adds attachments accessor to WikiContent::Version (#23242).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Jul 2016 03:27:33 +0000 (03:27 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Jul 2016 03:27:33 +0000 (03:27 +0000)
Patch by Jens Kraemer.

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

app/models/wiki_content.rb

index c549786eef53d65dbdc4c3c7e4c35706a6d6a01b..3c29f5be7d92d3595f0e56e548f3ad41b94a5b54 100644 (file)
@@ -118,6 +118,10 @@ class WikiContent < ActiveRecord::Base
       page.project
     end
 
+    def attachments
+      page.nil? ? [] : page.attachments
+    end
+
     # Return true if the content is the current page content
     def current_version?
       page.content.version == self.version