Sha256: e85664034bdddd39a2382a38f9045726977692d3dbfbd5786bb1ca9b272fa0c6

Contents?: true

Size: 347 Bytes

Versions: 3

Compression:

Stored size: 347 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

  voteable self, :up => +1, :down => -1, :index => true
  voteable Category, :up => +3, :down => -5, :update_counters => false
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
voteable_mongo-0.9.2 spec/mongoid/models/post.rb
voteable_mongo-0.9.1 spec/mongoid/models/post.rb
voteable_mongo-0.9.0 spec/mongoid/models/post.rb