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

22 lines
452 B
Ruby

class Template
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Slug
include Mongoid::Elasticsearch
field :title, type: String
field :author, type: String
field :preview, type: String
field :template, type: String
field :category_id, type: String
slug :title, history: true
belongs_to :category
mount_uploader :preview, ImageUploader
mount_uploader :template, ProductUploader
elasticsearch!
end