From db6988055218e6b71c55a628052ecda386058d72 Mon Sep 17 00:00:00 2001 From: Jens Kraemer Date: Tue, 5 Jul 2016 17:21:26 +0800 Subject: [PATCH] adds attachments accessor to WikiContent::Version --- 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 c549786..3c29f5b 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.1.4