forked from bofh/fetsite
modify attachments
This commit is contained in:
@@ -12,12 +12,12 @@
|
||||
|
||||
class Attachment < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
attr_accessible :name, :datei, :datei_cache
|
||||
attr_accessible :name, :datei, :datei_cache,:flag_titlepic
|
||||
belongs_to :thema
|
||||
mount_uploader :datei, AttachmentUploader
|
||||
validates :thema, :presence => true
|
||||
validates :name, :presence => true
|
||||
|
||||
belongs_to :parent, :polymorphic=>true
|
||||
def image?
|
||||
|
||||
# data_ext = datei.file.extension.downcase
|
||||
|
||||
@@ -22,6 +22,7 @@ include Rails.application.routes.url_helpers
|
||||
validates :themengruppe, :presence => true
|
||||
validates :title, :presence => true
|
||||
validates :text, :presence => true
|
||||
has_many :titlepics, :as=>:parent, :class_name=>'Attachment', :conditions=>{:flag_titlepic=>true}
|
||||
has_many :meetings, :as=>:parent
|
||||
has_many :documents, :as=>:parent
|
||||
scope :public, where(:isdraft=>false).includes(:themengruppe).where("themengruppen.public"=>true)
|
||||
|
||||
Reference in New Issue
Block a user