Sha256: 12d9ecf0a88d3ba6cac99e9f5d996ea06571c93b0f2ce69a7e5190dc44564067
Contents?: true
Size: 583 Bytes
Versions: 6
Compression:
Stored size: 583 Bytes
Contents
class Article include Mongoid::Document include Mongoid::Timestamps include Mongoid::Search include Ants::Id include Ants::Orderable ## Attributes field :title field :description field :body_html ## Uploader mount_uploader :image, ArticleImageUploader ## Search search_in :title, :description ## Scopes scope :sport_articles, -> { where(description: 'Sport News') } ## Indexes index({ description: 1 }) ## Helpers def _list_item_title title end def _list_item_thumbnail image? ? image.thumbnail_2x.url : '' end end
Version data entries
6 entries across 6 versions & 1 rubygems