<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>public/images/ico/star.gif</filename>
    </added>
    <added>
      <filename>public/images/ico/star_on.gif</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -21,4 +21,26 @@ module AnswersHelper
   def answer_this_question_link(question)
     link_to I18n.t(&quot;oracle.answers.answer_this_question&quot;), new_member_oracle_question_answer_path(question) if @question.opened?
   end
+  
+  def answer_and_rating_stars(answer)
+    out = []
+    out &lt;&lt; answer.body
+    out &lt;&lt; rating_stars(answer,'ico/star_on.gif','ico/star.gif')
+    out &lt;&lt; content_tag(:span, &quot;SUITABLE&quot;) if answer.suitable?
+    out.join(&quot; &quot;)
+  end
+  
+  # TODO: this should go to tog_core into the RatesHelper module
+  # Till then it stays here, since we cannot rely on the host app defining this helper.
+  def rating_stars(rateable, filled, empty)
+    if rateable.total_ratings &gt; 0
+      return stars(rateable, :filled_star =&gt; image_tag(filled), :empty_star =&gt; image_tag(empty)) do |content,rating,filled|
+        link_to content, member_rate_path(:type =&gt; rateable.class.name, :id =&gt; rateable.id, :rate =&gt; rating), :id =&gt; &quot;rating-link-#{rating}&quot;
+      end
+    else
+      return [1,2,3,4,5].collect{|i| 
+        link_to image_tag(empty), member_rate_path(:type =&gt; rateable.class.name, :id =&gt; rateable.id, :rate =&gt; i), :id =&gt; &quot;rating-link-#{i}&quot;
+      }
+    end
+  end
 end
\ No newline at end of file</diff>
      <filename>app/helpers/oracle/answers_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,12 @@
 class Oracle::Answer &lt; ActiveRecord::Base
-  
+
   belongs_to :question, :class_name =&gt; &quot;Oracle::Question&quot;
   belongs_to :user
 
   validates_presence_of :body
-  
+
+  acts_as_rateable :average =&gt; true
+
   def make_suitable!
     self.suitable = true
   end
@@ -12,7 +14,7 @@ class Oracle::Answer &lt; ActiveRecord::Base
   def make_unsuitable!
     self.suitable = false
   end
-  
+
   def suitable?
     !!self.suitable
   end</diff>
      <filename>app/models/oracle/answer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,3 @@
-&lt;li class=&quot;suitable_answer&quot;&gt;&lt;%= answer.body %&gt; &lt;%= content_tag(:span, &quot;SUITABLE&quot;) if answer.suitable? %&gt;&lt;/li&gt;
\ No newline at end of file
+&lt;% content_tag(:li, :class =&gt; (&quot;suitable_answer&quot; if answer.suitable?)) do -%&gt;
+  &lt;%= answer_and_rating_stars(answer) %&gt;
+&lt;% end -%&gt;
\ No newline at end of file</diff>
      <filename>app/views/oracle/answers/_answer.html.erb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>560e80ec3057d9f93d972d21454621bab57085c5</id>
    </parent>
  </parents>
  <author>
    <name>Balint Erdi</name>
    <email>balint.erdi@gmail.com</email>
  </author>
  <url>http://github.com/tog/tog_oracle/commit/fe4689d967c112c68e76b2486d04ba2489456592</url>
  <id>fe4689d967c112c68e76b2486d04ba2489456592</id>
  <committed-date>2009-04-29T05:11:29-07:00</committed-date>
  <authored-date>2009-04-29T05:11:29-07:00</authored-date>
  <message>answers are rateable

Signed-off-by: Balint Erdi &lt;balint.erdi@gmail.com&gt;</message>
  <tree>83854c3eb2f525f6a5b790beff7ce2b87c800caf</tree>
  <committer>
    <name>Balint Erdi</name>
    <email>balint.erdi@gmail.com</email>
  </committer>
</commit>
