modify attachments

This commit is contained in:
Andreas Stephanides
2015-02-11 20:53:25 +01:00
parent 5439d33a3c
commit 29a35f76d8
9 changed files with 52 additions and 17 deletions

View File

@@ -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