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

Version Path
chr-0.5.1 test/rails_app/app/models/article.rb
chr-0.5.0 test/rails_app/app/models/article.rb
chr-0.4.25 test/rails_app/app/models/article.rb
chr-0.4.24 test/rails_app/app/models/article.rb
chr-0.4.23 test/rails_app/app/models/article.rb
chr-0.4.22 test/rails_app/app/models/article.rb
chr-0.4.21 test/rails_app/app/models/article.rb
chr-0.4.20 test/rails_app/app/models/article.rb
chr-0.4.19 test/rails_app/app/models/article.rb
chr-0.4.18 test/rails_app/app/models/article.rb
chr-0.4.17 test/rails_app/app/models/article.rb
chr-0.4.15 test/rails_app/app/models/article.rb
chr-0.4.14 test/rails_app/app/models/article.rb
chr-0.4.13 test/rails_app/app/models/article.rb
chr-0.4.12 test/rails_app/app/models/article.rb
chr-0.4.11 test/rails_app/app/models/article.rb
chr-0.4.10 test/rails_app/app/models/article.rb
chr-0.4.9 test/rails_app/app/models/article.rb