<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>db/migrate/007_remove_user_from_ratings.rb</filename>
    </added>
    <added>
      <filename>test/functional/member/rates_controller_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -9,6 +9,7 @@ Edge
 * Caching Tog::Config values
 * Installation template now asks about installing gems as sudo
 * new generator for creating plugin's migrations, on installation and after updates
+* using acts_as_rateable and acts_as_shareable as plugins, which fixes problem with timestamps while installing
 
 0.5.4
 ----</diff>
      <filename>CHANGELOG.md</filename>
    </modified>
    <modified>
      <diff>@@ -5,16 +5,11 @@ class Member::RatesController &lt; Member::BaseController
     id = params[:id]
     rateable = type.constantize.find(id)
     
-    if(!rateable.ratings.include?(Rating.find_by_user_id(current_user.id)))
-      rating = rateable.rate params[:rate]
-      rating.user_id = current_user.id
-      if rating.save
-        flash[:ok] = I18n.t(&quot;tog_core.site.rating.added&quot;)
-      else
-        flash[:error] = I18n.t(&quot;tog_core.site.rating.error&quot;)
-      end
-    else
+    if rateable.rated_by?(current_user) == true
       flash[:error] = I18n.t(&quot;tog_core.site.rating.already_rated&quot;)
+    else
+      rateable.rate_it params[:rate], current_user
+      flash[:ok] = I18n.t(&quot;tog_core.site.rating.added&quot;)
     end
     respond_to do |format|
       format.html { redirect_to request.referer }</diff>
      <filename>app/controllers/member/rates_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
-&lt;%if rateable.total_ratings &gt; 0%&gt;
-  &lt;strong&gt;&lt;%= I18n.t(&quot;tog_core.site.rating.rating&quot;)%&gt;&lt;/strong&gt;&lt;br/&gt;
-  &lt;%= rateable.rating%&gt;&lt;br/&gt;
+&lt;%if rateable.ratings_count &gt; 0%&gt;
+  &lt;strong&gt;&lt;%= I18n.t(&quot;tog_core.site.rating.rating&quot;)%&gt;&lt;/strong&gt;: &lt;%= rateable.average_rating %&gt;&lt;br/&gt;
 &lt;%end%&gt;
 &lt;%if logged_in? %&gt;
   &lt;%= [1,2,3,4,5].collect{|i| rate_link(rateable, i) + &quot; &quot;}%&gt;</diff>
      <filename>app/views/shared/_rating.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,6 @@
 require_plugin 'acts_as_scribe'
 require_plugin 'acts_as_taggable_on_steroids'
 require_plugin 'acts_as_abusable'
-require_plugin 'acts_as_rateable'
 require_plugin 'viking'
 
 # require the will_paginate as a gem. This could be &#180;config.gem&#180; as well.</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,6 @@ require File.expand_path(File.dirname(__FILE__) + &quot;/../../../../config/environme
 require 'test_help'
 require 'test/unit'
 require 'action_view/test_case'
-require 'mocha'
 
 begin
   gem 'thoughtbot-shoulda', '&gt;=2.10.1'</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -69,7 +69,8 @@ def install_require_gems
   gem 'tog-tog', :lib =&gt; 'tog', :version =&gt; '&gt;= 0.5'
   gem 'thoughtbot-factory_girl', :lib =&gt; 'factory_girl'
   gem 'jackdempsey-acts_as_commentable', :lib =&gt; 'acts_as_commentable', :version =&gt; '2.0.1'
-  
+  gem &quot;mreinsch-acts_as_rateable&quot;, :lib =&gt; &quot;acts_as_rateable&quot;, :version =&gt; '2.0.1'
+      
   puts &quot;\n&quot;
   if yes?(&quot;Install required gems as root? (y/n)&quot;)
     rake &quot;gems:install&quot;, :sudo =&gt; true
@@ -102,47 +103,12 @@ def install_acts_as_commentable
 end
 
 def generate_acts_as_rateable_migration
-  sleep 1 # Template runner is too fast and generate multiple migrations with the same number
-  file &quot;db/migrate/&quot; + Time.now.strftime(&quot;%Y%m%d%H%M%S&quot;) + &quot;_add_ratings.rb&quot;,
-  %q{class AddRatings &lt; ActiveRecord::Migration
-      def self.up
-      create_table :ratings do |t|
-              t.column :rating, :integer    # You can add a default value here if you wish
-              t.column :rateable_id, :integer, :null =&gt; false
-              t.column :rateable_type, :string, :null =&gt; false
-      end
-      add_index :ratings, [:rateable_id, :rating]    # Not required, but should help more than it hurts
-      end
-
-      def self.down
-      drop_table :ratings
-      end
-  end
-  }
+  generate &quot;acts_as_rateable_migration &quot;
   puts &quot;* acts_as_rateable migration... #{&quot;generated&quot;.green.bold}&quot;;
 end
 
 def generate_acts_as_shareable_migration
-  sleep 1 # Template runner is too fast and generate multiple migrations with the same number
-  file &quot;db/migrate/&quot; + Time.now.strftime(&quot;%Y%m%d%H%M%S&quot;) + &quot;_create_shares.rb&quot;,
-  %q{class CreateShares &lt; ActiveRecord::Migration
-        def self.up
-          create_table :shares, :force =&gt; true do |t|
-            t.column :user_id,            :integer
-            t.column :shareable_type,     :string, :limit =&gt; 30
-            t.column :shareable_id,       :integer
-            t.column :shared_to_type,     :string, :limit =&gt; 30
-            t.column :shared_to_id,       :integer
-            t.column :created_at,         :datetime
-            t.column :updated_at,         :datetime
-          end
-        end
-  
-        def self.down
-          drop_table :shares
-        end
-  end
-  }
+  generate &quot;share_migration&quot;
   puts &quot;* acts_as_shareable migration... #{&quot;generated&quot;.green.bold}&quot;;
 end
 
@@ -283,12 +249,11 @@ installation_step &quot;Installing plugin dependencies...&quot; do
   
   install_git_plugins({
     'acts_as_taggable_on_steroids' =&gt; &quot;git://github.com/jviney/acts_as_taggable_on_steroids.git&quot;,
-    'acts_as_rateable'  =&gt; &quot;git://github.com/andry1/acts_as_rateable.git&quot;,
     'acts_as_abusable'  =&gt; &quot;git://github.com/linkingpaths/acts_as_abusable.git&quot;,
     'acts_as_scribe'    =&gt; &quot;git://github.com/linkingpaths/acts_as_scribe.git&quot;,
     'paperclip'         =&gt; &quot;git://github.com/thoughtbot/paperclip.git&quot;,
     'viking'            =&gt; &quot;git://github.com/technoweenie/viking.git&quot;,
-    'acts_as_shareable' =&gt; &quot;git://github.com/IamPersistent/acts_as_shareable.git&quot;
+    'acts_as_shareable' =&gt; &quot;git://github.com/molpe/acts_as_shareable.git&quot;
   })
   
 end</diff>
      <filename>tog_template.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>11a4c3dcbc2e69c06f69e2ed46e54203a362e4e4</id>
    </parent>
  </parents>
  <author>
    <name>Alberto Molpeceres</name>
    <email>alberto.molpeceres@gmail.com</email>
  </author>
  <url>http://github.com/tog/tog_core/commit/67a28fb7e7461e6141b8a279337bb0b0af532f4e</url>
  <id>67a28fb7e7461e6141b8a279337bb0b0af532f4e</id>
  <committed-date>2009-09-27T14:33:29-07:00</committed-date>
  <authored-date>2009-09-27T14:33:29-07:00</authored-date>
  <message>using acts_as_ratable as gem and changed repo for acts_As_shareable. Usig a different version of acts_as_rateable, hard migration required for ratings if upgrading</message>
  <tree>3ee1f809f364cbcb11c4d363f8de664ce5a0dc98</tree>
  <committer>
    <name>Alberto Molpeceres</name>
    <email>alberto.molpeceres@gmail.com</email>
  </committer>
</commit>
