Sha256: 2906598901c50ba40eaa4a6cf4ac1064340488bbc28684069266ee6a0bc4e085
Contents?: true
Size: 587 Bytes
Versions: 18
Compression:
Stored size: 587 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
18 entries across 18 versions & 1 rubygems