letsrate 1.0.6.alpha → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1 +1,3 @@
1
1
  .DS_Store
2
+ /pkg/*
3
+
data/README.md CHANGED
@@ -10,7 +10,7 @@ Find it at [github.com/muratguzel/letsrate](github.com/muratguzel/letsrate)
10
10
 
11
11
  ### Install
12
12
 
13
- You can add the letsrate gem into your Gemfile
13
+ Add the letsrate gem into your Gemfile
14
14
 
15
15
  gem 'letsrate'
16
16
 
@@ -25,9 +25,7 @@ Example:
25
25
 
26
26
  Suppose you will have a devise user model which name is User. The generator should be like below
27
27
 
28
- rails g devise:install
29
- rails g devise user
30
- rails g letsrate user # => This is letsrate generator.
28
+ rails g letsrate user # => user is the model generated by devise
31
29
 
32
30
  This generator will create Rate and RatingCache models and link to your user model.
33
31
 
@@ -37,10 +35,10 @@ I suppose you have a car model
37
35
 
38
36
  rails g model car name:string
39
37
 
40
- You should add the letsrate_rateable function with its dimensions option.
38
+ You should add the letsrate_rateable function with its dimensions option. You can add multiple dimensions.
41
39
 
42
40
  class Car < ActiveRecord::Base
43
- letsrate_rateable :dimensions => [:speed, :engine, :price]
41
+ letsrate_rateable "speed", "engine", "price"
44
42
  end
45
43
 
46
44
  Then you need to add a call letsrate_rater in the user model.
@@ -60,10 +58,16 @@ new rating value from authenticated user.
60
58
  Speed : <%= rating_for @car, "speed" %>
61
59
  Engine : <%= rating_for @car, "engine" %>
62
60
  Price : <%= rating_for @car, "price" %>
61
+
62
+ If you need to change the star number, you should use star option like below.
63
+
64
+ Speed : <%= rating_for @car, "speed", :star => 10 %>
65
+ Speed : <%= rating_for @car, "speed", :star => 7 %>
66
+ Speed : <%= rating_for @car, "speed" %>
63
67
 
64
68
  ### Important
65
69
 
66
- By default rating_for tries to call current_user method as the rater instance in the rater_controller.rb file. You can change the current_user method
70
+ By default rating_for tries to call devise current_user method as the rater instance in the rater_controller.rb file. You can change the current_user method
67
71
  as you will.
68
72
 
69
73
  #rater_controller.rb
@@ -1,5 +1,5 @@
1
1
  require 'rails/generators/migration'
2
- class LestrateGenerator < Rails::Generators::NamedBase
2
+ class LetsrateGenerator < Rails::Generators::NamedBase
3
3
  include Rails::Generators::Migration
4
4
 
5
5
  source_root File.expand_path('../templates', __FILE__)
@@ -1,3 +1,3 @@
1
1
  module Letsrate
2
- VERSION = "1.0.6.alpha"
2
+ VERSION = "1.0.7"
3
3
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letsrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6.alpha
5
- prerelease: 6
4
+ version: 1.0.7
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Murat GUZEL
@@ -57,12 +57,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
57
  required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  none: false
59
59
  requirements:
60
- - - ! '>'
60
+ - - ! '>='
61
61
  - !ruby/object:Gem::Version
62
- version: 1.3.1
62
+ version: '0'
63
63
  requirements: []
64
64
  rubyforge_project: letsrate
65
- rubygems_version: 1.8.21
65
+ rubygems_version: 1.8.24
66
66
  signing_key:
67
67
  specification_version: 3
68
68
  summary: Provides the best solution to add rating functionality to your models.