Sha256: 88afaecc2aa61cc2bcf2e56773959282dd3853ac0c1b625051f729b14a6d914a

Contents?: true

Size: 365 Bytes

Versions: 1

Compression:

Stored size: 365 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
  
  key :title
  
  voteable self, :up => +1, :down => -1, :index => true
  voteable Category, :up => +3, :down => -5, :update_counters => false
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
voteable_mongo-0.9.3 spec/mongoid/models/post.rb