Files
fetsite/app/models/attachment.rb
HausdorffHimself 348c81b856 NEW: Uploader
2013-08-27 18:34:55 +02:00

21 lines
501 B
Ruby

# == Schema Information
#
# Table name: attachments
#
# id :integer not null, primary key
# name :string(255)
# datei :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# thema_id :integer
#
class Attachment < ActiveRecord::Base
has_paper_trail
attr_accessible :name, :datei
belongs_to :thema
mount_uploader :datei, AttachmentUploader
validates :thema, :presence => true
validates :name, :presence => true
end