diff --git a/README b/README index f11a8d4..12a5aa1 100644 --- a/README +++ b/README @@ -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