25 lines
516 B
Ruby
25 lines
516 B
Ruby
class Extension
|
|
include Mongoid::Document
|
|
include Mongoid::Timestamps
|
|
include Mongoid::Slug
|
|
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
|
|
field :category_id, type: String
|
|
|
|
slug :title, history: true
|
|
|
|
belongs_to :category
|
|
|
|
mount_uploader :preview, ImageUploader
|
|
mount_uploader :extension, ProductUploader
|
|
|
|
elasticsearch!
|
|
end
|