Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Simple and powerful rating solution for mongoid
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.document
.gitignore
Gemfile
Gemfile.lock
LICENSE.txt
README
README.rdoc
Rakefile
VERSION
mongoid-rating.gemspec

README.rdoc

mongoid-rating

Rating solution for mongoid.

Usage

class User
    include Mongoid::Document
end

class Photo
    include Mongoid::Document
    include Mongoid::Rating
end

Do you want rate a photo as a user? Just type:

photo.rate(:by => user, :value => 10).save

or

photo.rate!(:by => user, :value => 10) # same as above

mongoid-rating store information about user and score in :rates field. Some useful methods:

photo.rated?(:by => user)   # should return true if user rate a photo
photo.rates_count
photo.rates_average
photo.rates_sum

Copyright

Copyright © 2011 Łukasz Śliwa. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.