27 lines
844 B
Ruby
27 lines
844 B
Ruby
|
class RTemplate
|
||
|
include Mongoid::Document
|
||
|
include Mongoid::Timestamps
|
||
|
include OrbitModel::Status
|
||
|
include OrbitTag::Taggable
|
||
|
include OrbitCategory::Categorizable
|
||
|
include Slug
|
||
|
|
||
|
|
||
|
field :title, as: :slug_title, :localize => true
|
||
|
field :description, :localize => true
|
||
|
field :price, :type => Integer
|
||
|
field :allowed, :type => Boolean, :default => true
|
||
|
field :user_id
|
||
|
field :colors, :type => Array, :default => []
|
||
|
field :sold, :type => Boolean, :default => false
|
||
|
|
||
|
|
||
|
mount_uploader :template_zip, AssetUploader
|
||
|
|
||
|
has_many :template_image_files, :autosave => true, :dependent => :destroy
|
||
|
has_one :template_psd_file, :autosave => true, :dependent => :destroy
|
||
|
|
||
|
accepts_nested_attributes_for :template_image_files, :allow_destroy => true
|
||
|
accepts_nested_attributes_for :template_psd_file, :allow_destroy => true
|
||
|
|
||
|
end
|