No commit activity in last 3 years
No release in over 3 years
Demonstrates a reference implementation for handling ratings in ActiveRecord
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Dependencies

Runtime

>= 0.4.0
 Project Readme

has_ratings ¶ ↑

has_ratings demonstrates a reference implementation for handling ratings.

Resources¶ ↑

API

Bugs

Development

Testing

Source

  • git://github.com/pluginaweek/has_ratings.git

Mailing List

Description¶ ↑

Storing ratings is a pretty common task when building web applications with a community-based focus. Ratings can have names and values associated with them. This plugin demonstrate a simple way to manage what ratings can be used and how they are persisted.

Usage¶ ↑

Note that this is a reference implementation and, most likely, should be modified for your own usage.

Installation¶ ↑

has_ratings requires additional database tables to work. You can generate a migration for these tables like so:

script/generate has_ratings

Then simply migrate your database:

rake db:migrate

Example¶ ↑

user = User.find(1)
video = Video.find(1)

video.ratings.create(:rater => user, :value => 'poor')
video.ratings.average   # => 1.0

Assets¶ ↑

Included with the plugin are image/stylesheet assets for creating raters using css as described at www.komodomedia.com/blog/2007/01/css-star-rating-redux

Testing¶ ↑

Before you can run any tests, the following gem must be installed:

To run against a specific version of Rails:

rake test RAILS_FRAMEWORK_ROOT=/path/to/rails

Dependencies¶ ↑