<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/models/rating_value.rb</filename>
    </added>
    <added>
      <filename>lib/has_ratings.rb</filename>
    </added>
    <added>
      <filename>test/app_root/app/models/user.rb</filename>
    </added>
    <added>
      <filename>test/app_root/app/models/video.rb</filename>
    </added>
    <added>
      <filename>test/app_root/config/environment.rb</filename>
    </added>
    <added>
      <filename>test/app_root/db/migrate/001_create_users.rb</filename>
    </added>
    <added>
      <filename>test/app_root/db/migrate/002_create_videos.rb</filename>
    </added>
    <added>
      <filename>test/app_root/db/migrate/003_migrate_has_ratings_to_version_1.rb</filename>
    </added>
    <added>
      <filename>test/factory.rb</filename>
    </added>
    <added>
      <filename>test/functional/has_ratings_test.rb</filename>
    </added>
    <added>
      <filename>test/test_helper.rb</filename>
    </added>
    <added>
      <filename>test/unit/rating_test.rb</filename>
    </added>
    <added>
      <filename>test/unit/rating_value_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,2 +1,5 @@
 *SVN*
 
+*0.0.1* (May 9th, 2008)
+
+* Initial public release</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-Copyright (c) 2006 Cosmin Radoi
+Copyright (c) 2006-2008 Aaron Pfeifer
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</diff>
      <filename>MIT-LICENSE</filename>
    </modified>
    <modified>
      <diff>@@ -1,31 +1,50 @@
-== acts_as_ratable
+== has_ratings
 
-acts_as_ratable .
+has_ratings demonstrates a reference implementation for handling ratings.
 
 == Resources
 
 Wiki
 
-* http://wiki.pluginaweek.org/Acts_as_ratable
+* http://wiki.pluginaweek.org/Has_ratings
 
-Announcement
+API
 
-* http://www.pluginaweek.org/
+* http://api.pluginaweek.org/has_ratings
 
 Source
 
-* http://svn.pluginaweek.org/trunk/plugins/active_record/acts/acts_as_ratable
+* http://svn.pluginaweek.org/trunk/has_ratings
 
 Development
 
-* http://dev.pluginaweek.org/browser/trunk/plugins/active_record/acts/acts_as_ratable
+* http://dev.pluginaweek.org/browser/trunk/has_ratings
 
 == 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
 
-== References
+Note that this is a reference implementation and, most likely, should be
+modified for your own usage.
 
-Xelipe - This plugin is heavily influced by Acts As Tagglable.
-http://www.juixe.com/techknow/index.php/2006/06/18/acts-as-commentable-plugin/
-http://www.juixe.com/projects/acts_as_commentable
+=== Example
+
+  user = User.find(1)
+  video = Video.find(1)
+  
+  video.ratings.create(:rater =&gt; user, :value =&gt; :poor)
+
+== Testing
+
+Before you can run any tests, the following gem must be installed:
+* plugin_test_helper[http://wiki.pluginaweek.org/Plugin_test_helper]
+
+== Dependencies
+
+* plugins_plus[http://wiki.pluginaweek.org/Plugins_plus]
+* acts_as_enumeration[http://wiki.pluginaweek.org/Acts_as_enumeration]</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,10 @@ require 'rake/rdoctask'
 require 'rake/gempackagetask'
 require 'rake/contrib/sshpublisher'
 
-PKG_NAME           = 'acts_as_ratable'
+# Load custom rakefile extensions
+Dir[&quot;#{File.dirname(__FILE__)}/tasks/**/*.rake&quot;].sort.each {|ext| load ext}
+
+PKG_NAME           = 'has_ratings'
 PKG_VERSION        = '0.0.1'
 PKG_FILE_NAME      = &quot;#{PKG_NAME}-#{PKG_VERSION}&quot;
 RUBY_FORGE_PROJECT = 'pluginaweek'
@@ -11,17 +14,17 @@ RUBY_FORGE_PROJECT = 'pluginaweek'
 desc 'Default: run unit tests.'
 task :default =&gt; :test
 
-desc 'Test the acts_as_ratable plugin.'
+desc 'Test the has_ratings plugin.'
 Rake::TestTask.new(:test) do |t|
   t.libs &lt;&lt; 'lib'
   t.pattern = 'test/**/*_test.rb'
   t.verbose = true
 end
 
-desc 'Generate documentation for the acts_as_ratable plugin.'
+desc 'Generate documentation for the has_ratings plugin.'
 Rake::RDocTask.new(:rdoc) do |rdoc|
   rdoc.rdoc_dir = 'rdoc'
-  rdoc.title    = 'ActsAsRatable'
+  rdoc.title    = 'HasRatings'
   rdoc.options &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source'
   rdoc.rdoc_files.include('README')
   rdoc.rdoc_files.include('lib/**/*.rb')
@@ -31,16 +34,17 @@ spec = Gem::Specification.new do |s|
   s.name            = PKG_NAME
   s.version         = PKG_VERSION
   s.platform        = Gem::Platform::RUBY
-  s.summary         = ''
+  s.summary         = 'Demonstrates a reference implementation for handling ratings.'
   
-  s.files           = FileList['{app,assets,db,lib,tasks,test}/**/*'].to_a + %w(init.rb MIT-LICENSE Rakefile README)
+  s.files           = FileList['{app,assets,db,lib,test}/**/*'].to_a + %w(CHANGELOG init.rb MIT-LICENSE Rakefile README)
   s.require_path    = 'lib'
-  s.autorequire     = 'acts_as_ratable'
+  s.autorequire     = 'has_ratings'
   s.has_rdoc        = true
   s.test_files      = Dir['test/**/*_test.rb']
+  s.add_dependency  'acts_as_enumeration', '&gt;= 0.1.0'
   
-  s.author          = 'Aaron Pfeifer, Neil Abraham'
-  s.email           = 'info@pluginaweek.org'
+  s.author          = 'Aaron Pfeifer'
+  s.email           = 'aaron@pluginaweek.org'
   s.homepage        = 'http://www.pluginaweek.org'
 end
   
@@ -52,16 +56,16 @@ end
 
 desc 'Publish the beta gem'
 task :pgem =&gt; [:package] do
-  Rake::SshFilePublisher.new('pluginaweek@pluginaweek.org', '/home/pluginaweek/gems.pluginaweek.org/gems', 'pkg', &quot;#{PKG_FILE_NAME}.gem&quot;).upload
+  Rake::SshFilePublisher.new('aaron@pluginaweek.org', '/home/aaron/gems.pluginaweek.org/public/gems', 'pkg', &quot;#{PKG_FILE_NAME}.gem&quot;).upload
 end
 
 desc 'Publish the API documentation'
 task :pdoc =&gt; [:rdoc] do
-  Rake::SshDirPublisher.new('pluginaweek@pluginaweek.org', &quot;/home/pluginaweek/api.pluginaweek.org/#{PKG_NAME}&quot;, 'rdoc').upload
+  Rake::SshDirPublisher.new('aaron@pluginaweek.org', &quot;/home/aaron/api.pluginaweek.org/public/#{PKG_NAME}&quot;, 'rdoc').upload
 end
 
 desc 'Publish the API docs and gem'
-task :publish =&gt; [:pdoc, :release]
+task :publish =&gt; [:pgem, :pdoc, :release]
 
 desc 'Publish the release files to RubyForge.'
 task :release =&gt; [:gem, :package] do
@@ -76,4 +80,4 @@ task :release =&gt; [:gem, :package] do
     
     ruby_forge.add_release(RUBY_FORGE_PROJECT, PKG_NAME, PKG_VERSION, file)
   end
-end
\ No newline at end of file
+end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,15 @@
-# 
+# A rating of a particular record
 class Rating &lt; ActiveRecord::Base
-  validates_presence_of     :ratable_id,
-                            :ratable_type,
-                            :rater_id,
-                            :rater_type,
-                            :value
-  validates_numericality_of :value
+  belongs_to  :value,
+                :class_name =&gt; 'RatingValue'
+  belongs_to  :ratable,
+                :polymorphic =&gt; true
+  belongs_to  :rater,
+                :polymorphic =&gt; true
   
-  # 
-  def name
-    self.class::RatingName.find_by_owner_type_and_value(ratable_type, value).name
-  end
-end
\ No newline at end of file
+  validates_presence_of :ratable_id,
+                        :ratable_type,
+                        :rater_id,
+                        :rater_type,
+                        :value_id
+end</diff>
      <filename>app/models/rating.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-.star-rating{
+.star-rating {
   position: relative;
   float: left;
   width: 150px;
@@ -9,7 +9,7 @@
   background: url(../images/star.gif) top left repeat-x;
 }
 
-.star-rating li{
+.star-rating li {
   padding: 0px;
   margin: 0px;
   /*\*/
@@ -17,7 +17,7 @@
   /* */
 }
 
-.star-rating li a{
+.star-rating li a {
   position: absolute;
   display: block;
   width: 30px;
@@ -28,57 +28,57 @@
   z-index: 20;
 }
 
-.star-rating li a:hover{
+.star-rating li a:hover {
   left: 0px;
   background: url(../images/star.gif) left bottom;
   z-index: 2;
 }
 
-.star-rating a.star1{
+.star-rating a.star1 {
   left: 0px;
 }
 
-.star-rating a.star1:hover{
+.star-rating a.star1:hover {
   width: 30px;
 }
 
-.star-rating a.star2{
+.star-rating a.star2 {
   left: 30px;
 }
 
-.star-rating a.star2:hover{
+.star-rating a.star2:hover {
   width: 60px;
 }
 
-.star-rating a.star3{
+.star-rating a.star3 {
   left: 60px;
 }
 
-.star-rating a.star3:hover{
+.star-rating a.star3:hover {
   width: 90px;
 }
 
-.star-rating a.star4{
+.star-rating a.star4 {
   left: 90px;
 }
 
-.star-rating a.star4:hover{
+.star-rating a.star4:hover {
   width: 120px;
 }
 
-.star-rating a.star5{
+.star-rating a.star5 {
   left: 120px;
 }
 
-.star-rating a.star5:hover{
+.star-rating a.star5:hover {
   width: 150px;
 }
 
-.star-rating li.current-rating{
+.star-rating li.current-rating {
   position: absolute;
   display: block;
   height: 25px;
   background: url(../images/star.gif) left center;
   text-indent: -9000px;
   z-index: 1;
- }
\ No newline at end of file
+}</diff>
      <filename>assets/stylesheets/star.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,14 @@
 class CreateRatings &lt; ActiveRecord::Migration
   def self.up
     create_table :ratings do |t|
-      t.column :ratable_id,   :integer,   :null =&gt; false, :unsigned =&gt; true, :references =&gt; nil
-      t.column :ratable_type, :string,    :null =&gt; false
-      t.column :rater_id,     :integer,   :null =&gt; false, :unsigned =&gt; true, :references =&gt; nil
-      t.column :rater_type,   :string,    :null =&gt; false
-      t.column :value,        :integer,   :null =&gt; false
-      t.column :created_at,   :datetime,  :null =&gt; false
+      t.references :ratable, :polymorphic =&gt; true, :null =&gt; false
+      t.references :rater, :polymorphic =&gt; true, :null =&gt; false
+      t.references :value, :null =&gt; false
+      t.timestamps
     end
-    add_index :ratings, [:ratable_id, :ratable_type, :rater_id, :rater_type], :unique =&gt; true, :name =&gt; 'index_ratings_on_ratable_and_rater'
   end
   
   def self.down
     drop_table :ratings
   end
-end
\ No newline at end of file
+end</diff>
      <filename>db/migrate/001_create_ratings.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-require 'acts_as_ratable'
\ No newline at end of file
+require 'has_ratings'</diff>
      <filename>init.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>app/models/rating_name.rb</filename>
    </removed>
    <removed>
      <filename>db/migrate/002_create_rating_names.rb</filename>
    </removed>
    <removed>
      <filename>lib/acts_as_ratable.rb</filename>
    </removed>
    <removed>
      <filename>tests/acts_as_ratable_test.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>b87dc1b9fe0ed08092cb3111d34c5652deaa1c6f</id>
    </parent>
  </parents>
  <author>
    <name>Aaron Pfeifer</name>
    <email>aaron.pfeifer@gmail.com</email>
  </author>
  <url>http://github.com/pluginaweek/has_ratings/commit/6ff276309423821b0221814ee4bd7560a538e9d0</url>
  <id>6ff276309423821b0221814ee4bd7560a538e9d0</id>
  <committed-date>2008-05-09T17:53:29-07:00</committed-date>
  <authored-date>2008-05-09T17:53:29-07:00</authored-date>
  <message>Rename RatingName to RatingValue and use acts_as_enumeration for storage
Update documentation
Add tests</message>
  <tree>d95f4c45456489492b0809693eebad891eab048f</tree>
  <committer>
    <name>Aaron Pfeifer</name>
    <email>aaron.pfeifer@gmail.com</email>
  </committer>
</commit>
