<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -19,6 +19,7 @@ h2. Credits
 * &quot;Zach Inglis&quot;:http://zachinglis.com
 * &quot;Nathan Arnold&quot;:http://shorepound.net
 * &quot;Tim Pope&quot;:http://www.tpope.net
+* &quot;Rogie King&quot;:http://komodomedia.com - CSS for Stars
 * Some code from restful_authentication by &quot;Rick Olson&quot;:http://activereload.com
 
 *Copyright (c) 2008 Zach Inglis, released under the MIT license*</diff>
      <filename>README.textile</filename>
    </modified>
    <modified>
      <diff>@@ -2,4 +2,8 @@ script/generate ratable
 
 User model:
   add:
-    has_many :ratings, :dependent =&gt; :nullify
\ No newline at end of file
+    has_many :ratings, :dependent =&gt; :nullify
+    
+CSS:
+  add:
+    CSS from http://www.komodomedia.com/samples/ratings.htm
\ No newline at end of file</diff>
      <filename>generators/rateable/USAGE</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,13 @@
 #  updated_at    :datetime
 #
 class Rating &lt; ActiveRecord::Base
-  validates_presence_of :rateable_type, :rateable_id
+  validates_presence_of     :rateable_type, :rateable_id
+  validates_numericality_of :value
+  validate                  :maximum_value_is_not_breached
+  
+  def maximum_value_is_not_breached
+    errors.add('value', 'is not in the range') unless self.rateable.rating_range.include?(self.value)
+  end
   
   belongs_to :rateable, :polymorphic =&gt; true
-end
\ No newline at end of file
+end</diff>
      <filename>generators/rateable/templates/model.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,3 @@
 require 'is_rateable'
-ActiveRecord::Base.send :include, IsRateable
\ No newline at end of file
+ActiveRecord::Base.send :include, IsRateable
+ActionView::Base.send   :include, IsRateable::ViewMethods</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,8 +18,26 @@ module IsRateable
       Rating.average(:value) || 0
     end
     
+    def rating_range
+      0..self.maximum_rating_allowed
+    end
+    
     def add_rating(value)
       self.ratings.create!(:value =&gt; value)
     end
   end
+  
+  module ViewMethods
+    def render_rating(object, type=:simple, units=&quot;stars&quot;)
+      case type
+      when :simple
+        &quot;#{object.rating}/#{object.maximum_rating_allowed} #{units}&quot;
+      when :stars
+        content_tag(:ul) do
+          object.rating_range
+            content_tag :li, &quot;1&quot;, :class =&gt; &quot;one-star&quot;, :class =&gt; &quot;Rate this 1 star out of 5&quot;
+        end
+      end
+    end
+  end
 end</diff>
      <filename>lib/is_rateable.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e277199a21c69d750ca8ef9503e2aa86edf65a57</id>
    </parent>
  </parents>
  <author>
    <name>Zach Inglis</name>
    <email>zach@lt3media.com</email>
  </author>
  <url>http://github.com/zachinglis/is_rateable/commit/462d46785ee6bd128998bb1bc9bf588decc7a158</url>
  <id>462d46785ee6bd128998bb1bc9bf588decc7a158</id>
  <committed-date>2008-07-17T11:02:00-07:00</committed-date>
  <authored-date>2008-07-17T11:02:00-07:00</authored-date>
  <message>Started work on the view helpers</message>
  <tree>c711875c6b0fc615c8e0e02460f41f9970598649</tree>
  <committer>
    <name>Zach Inglis</name>
    <email>zach@lt3media.com</email>
  </committer>
</commit>
