Sha256: 315153f6e3370a0dd0d25f74db94cb086bdc075eb31fe951eaeb0d11e6f1f8c3

Contents?: true

Size: 402 Bytes

Versions: 6

Compression:

Stored size: 402 Bytes

Contents

require File.join(File.dirname(__FILE__), 'category')

class Post
  include Mongoid::Document
  include Mongo::Voteable

  field :title
  field :content
  
  has_and_belongs_to_many :categories
  has_many :comments
  
  field :_id, type: String, default: -> { title }
  
  voteable self, :up => +1, :down => -1, :index => true
  voteable Category, :up => +3, :down => -5, :update_counters => false
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rs_voteable_mongo-1.3.0 spec/mongoid/models/post.rb
rs_voteable_mongo-1.2.0 spec/mongoid/models/post.rb
rs_voteable_mongo-1.1.0 spec/mongoid/models/post.rb
rs_voteable_mongo-1.0.2 spec/mongoid/models/post.rb
rs_voteable_mongo-1.0.1 spec/mongoid/models/post.rb
rs_voteable_mongo-1.0.0 spec/mongoid/models/post.rb