module-and-template-store/app/models/template.rb

22 lines
452 B
Ruby
Raw Normal View History

2013-12-25 10:39:05 +00:00
class Template
2014-01-10 08:48:23 +00:00
2013-12-25 10:39:05 +00:00
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Slug
2014-01-10 08:48:23 +00:00
include Mongoid::Elasticsearch
2013-12-25 10:39:05 +00:00
field :title, type: String
field :author, type: String
field :preview, type: String
field :template, type: String
2014-01-10 08:48:23 +00:00
field :category_id, type: String
slug :title, history: true
2014-01-10 08:48:23 +00:00
belongs_to :category
2013-12-25 10:39:05 +00:00
mount_uploader :preview, ImageUploader
mount_uploader :template, ProductUploader
2014-01-10 08:48:23 +00:00
elasticsearch!
2013-12-25 10:39:05 +00:00
end