Forum: Ruby on Rails [ANN] New rails plugin: acts_as_rated

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Cbff7ea94c9b2c4d5f7cfefd25be9ae2?d=identicon&s=25 Just Someone (Guest)
on 2007-02-05 11:47
(Received via mailing list)
I just released on RubyForge ( a
new rails plugin for rating ActiveRecord objects. Though there are two
other plugins with similar functionality, they didn't provide
everything I wanted, so I rolled my own.

The main difference from the other plugins is the ability to store the
statistics of the rating for each object (total/count/average) in the
model itself or in an external statistics table. This eliminates the
need to issue count/sum/avg calls on the ratings table itself, making
it a lot faster to display, and especially to search for objects by

The plugin has lots of configuration options, include all needed
methods to include in migrations, and has a very extensive test suite.
The migration has methods for creating the ratings table, the rating
statistics table and to add extra fields to the model that we want to
add ratings to. Whichever way is chosen, the plugin will adjust itself

More Details
RubyForge project page:
svn: svn://
Blog post about it:

Usage example:
class Book < ActiveRecord::Base

u = User.find_by_name "guy"
b = Book.find "Catch 22"
b.rate 5, u
u = User.find_by_name "john"
b.rate 3, u

b.rating_average # => 4
Book.find_by_rating 2..3 # => [<Book:"Catch 22">]

b.find_rated_by User.find_by_name("guy") # => [<Book:"Catch 22">]


Guy Naor

Family management on rails:
My development related blog:
This topic is locked and can not be replied to.