Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Maiz committed Feb 25, 2010
1 parent fda8935 commit 85c84c1
Showing 1 changed file with 2 additions and 49 deletions.
51 changes: 2 additions & 49 deletions README
Original file line number Diff line number Diff line change
@@ -1,52 +1,5 @@
DataGrid
Komerci
==============

== Resources
Versão ainda tosca do sistema de pagamentos Komerci/Mastercard em Rails.

Install
* Run the following command:
script/plugin install @TODO colocar no github for free...

* Create a new rails migration and add the following self.up and self.down methods

def self.up
create_table "ratings", :force => true do |t|
t.column "rating", :integer, :default => 0
t.column "created_at", :datetime, :null => false
t.column "rateable_type", :string, :limit => 15, :default => "", :null => false
t.column "rateable_id", :integer, :default => 0, :null => false
t.column "user_id", :integer, :default => 0, :null => false
end

add_index "ratings", ["user_id"], :name => "fk_ratings_user"
end

def self.down
drop_table :ratings
end

== Usage
* Make you ActiveRecord model act as rateable.

class Model < ActiveRecord::Base
acts_as_rateable
end

* Add a rating to a model instance

model = Model.new
rating = Rating.new(:rating => 1)
model.ratings << rating

* Each rating references the rateable object

model = Model.find(1)
model.ratings.get(0).rateable == model

== Credits

Xelipe - This plugin is heavily influced by Acts As Voteable.

== More

http://www.juixe.com/projects/acts_as_rateable

0 comments on commit 85c84c1

Please sign in to comment.