summaryrefslogtreecommitdiffstats
path: root/app/models/wiki_page.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r--app/models/wiki_page.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index b7964a119..562465197 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -18,6 +18,7 @@
class WikiPage < ActiveRecord::Base
belongs_to :wiki
has_one :content, :class_name => 'WikiContent', :foreign_key => 'page_id', :dependent => :destroy
+ has_many :attachments, :as => :container, :dependent => :destroy
validates_presence_of :title
validates_format_of :title, :with => /^[^,\.\/\?\;\|\s]*$/
@@ -41,4 +42,8 @@ class WikiPage < ActiveRecord::Base
def self.pretty_title(str)
(str && str.is_a?(String)) ? str.tr('_', ' ') : str
end
+
+ def project
+ wiki.project
+ end
end