From 027fe7bb6622b3daea09028ca9f06fe094cd3b53 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 9 Jul 2016 03:27:33 +0000 Subject: [PATCH] Adds attachments accessor to WikiContent::Version (#23242). Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@15610 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/wiki_content.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/wiki_content.rb b/app/models/wiki_content.rb index c549786ee..3c29f5be7 100644 --- a/app/models/wiki_content.rb +++ b/app/models/wiki_content.rb @@ -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 -- 2.39.5