2010-02-01 09:24:28 +00:00
|
|
|
class Asset
|
|
|
|
|
2011-04-13 10:19:51 +00:00
|
|
|
include Mongoid::Document
|
2011-03-08 09:25:46 +00:00
|
|
|
include Mongoid::Timestamps
|
2010-02-01 09:24:28 +00:00
|
|
|
|
2011-04-13 10:19:51 +00:00
|
|
|
mount_uploader :data, AssetUploader
|
2010-02-01 09:24:28 +00:00
|
|
|
|
2011-04-13 10:19:51 +00:00
|
|
|
field :filename
|
|
|
|
field :description
|
2010-02-01 09:24:28 +00:00
|
|
|
|
2011-04-13 10:19:51 +00:00
|
|
|
validates_presence_of :filename, :data
|
2012-05-16 03:07:11 +00:00
|
|
|
|
|
|
|
belongs_to :asset_category
|
|
|
|
belongs_to :assetable, polymorphic: true
|
2010-02-05 08:15:16 +00:00
|
|
|
|
2011-04-13 10:19:51 +00:00
|
|
|
end
|