Sha256: 8ccb6d21f27b6ac7f7a278567c092ff4ff6fd08d69a31df1d28c78f11b04b5e6

Contents?: true

Size: 390 Bytes

Versions: 4

Compression:

Stored size: 390 Bytes

Contents

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

class Post
  include MongoMapper::Document
  include Mongo::Voteable

  key :title, String
  key :content, String
  
  key :category_ids, Array
  many :categories, :in => :category_ids

  many :comments

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

Version data entries

4 entries across 4 versions & 1 rubygems

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