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

@@ -22,7 +22,7 @@ class Thema < ActiveRecord::Base
# Each topic has multiple questions, that are also referenced in the FAQ.
has_many :fragen
# Attachments can be all data formats
has_many :attachments
has_many :attachments, :as=>:parent
# attached pics can be used as title pictures
has_many :titlepics, :as=>:parent, :class_name=>'Attachment', :conditions=>{:flag_titlepic=>true}
# each topic has to belong to one group