attachments has_many for document, neuigkeit, thema

This commit is contained in:
Andreas Stephanides
2015-04-07 23:23:14 +02:00
parent 04b6bcac8a
commit 080150f11b
4 changed files with 6 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ class Document < ActiveRecord::Base
validate :parent, :presence=>true
has_paper_trail
TYPS = { 1=>"fet_docs", 10=>"protocol", 11=> "agenda"}
has_many :attachments, :as=>:parent
def long_name
if self.parent.class=="Meeting"
"<b>"+self.parent.text+ "</b>"+ self.name