Plugins - acts_as_rated

StarAdd to favorites

The ultimate rating system for ActiveRecord models. Highly flexible and configurable, while easy to use with the defaults. Supports 3 different ways to manage the statistics, and creates all the needed associations for easy access to everything.

Comes complete with the needed migrations code to make it easy to add to any project.

NOTE: It uses some advanced SQL constructs that might not be supported by all servers. It was tested on Postgres only. If you have patches/fixes for other databases, please send them and I will add them to the plugin.

Features

  • Rate any model
  • Optionally add fields to the rated objects to optimize speed
  • Optionally add an external rating statistics table with a record for each rated model
  • Can work with the added fields, external table or just using direct SQL count/avg calls
  • Use any model as the rater (defaults to User)
  • Limit the range of the ratings
  • Average, total and number of ratings
  • Find objects by ratings or rating ranges
  • Find objects by rater
  • Extensively tested

Guy Naor

http://acts-as-rated.rubyforge.org

svn://rubyforge.org/var/svn/acts-as-rated/trunk/acts_as_rated

Rails' (MIT)

  • Currently 4.1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Model

Tags

Comments

Add a comment
Michael 4 Jun 2008

Great Plugin.

To get decimal numbers for the rating_avg instead of integers you have to change the following lines (216 and 225)

Remove: target.ratingavg = target.ratingtotal / target.rating_count

Insert: target.ratingavg = target.ratingtotal target.ratingavg /= target.ratingcount

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?