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

25 lines
516 B
Ruby
Raw Normal View History

class Extension
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Slug
2014-01-10 08:48:23 +00:00
include Mongoid::Elasticsearch
include CategoryFilter
field :title, type: String
field :author, type: String
field :preview, type: String
field :extension, type: String
field :description, 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
mount_uploader :preview, ImageUploader
mount_uploader :extension, ProductUploader
2014-01-10 08:48:23 +00:00
elasticsearch!
end