acts_as_votable 0.5.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7b8402806ab189425b71b1d24d2081123e6bffc1
4
+ data.tar.gz: 48de253feb1e0df3ef42cd798faaaf8f91f36b47
5
+ SHA512:
6
+ metadata.gz: 7189eeb6505d6394bb090d58618d23ee13e36e6512f0416a15bf984c489e0775952680b748cadc054bd4948260184ac4a457ef6dee3b34f279561245adb2213e
7
+ data.tar.gz: 0fd78166628e72e3c77b8b5c8b8ba0028aa3069afb217816324c470ce6cc0c5a809431fcf47a800e440bbcb49020778e54f6f082698321357ded582081f488b0
data/.gitignore CHANGED
@@ -2,4 +2,5 @@ pkg/*
2
2
  *.gem
3
3
  .bundle
4
4
  nbproject/*
5
+ Gemfile.lock
5
6
  bin
data/.travis.yml ADDED
@@ -0,0 +1,25 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - 2.0.0
7
+ - 2.1.0
8
+ env:
9
+ - "RAILS_VERSION=3.0.0"
10
+ - "RAILS_VERSION=3.1.0"
11
+ - "RAILS_VERSION=3.2.0"
12
+ - "RAILS_VERSION=4.0.0"
13
+ - "RAILS_VERSION=4.1.0"
14
+ matrix:
15
+ exclude:
16
+ - rvm: 1.8.7
17
+ env: "RAILS_VERSION=4.0.0"
18
+ - rvm: 1.9.2
19
+ env: "RAILS_VERSION=4.0.0"
20
+ - rvm: 1.8.7
21
+ env: "RAILS_VERSION=4.1.0"
22
+ - rvm: 1.9.2
23
+ env: "RAILS_VERSION=4.1.0"
24
+ - rvm: 1.9.3
25
+ env: "RAILS_VERSION=4.1.0"
data/Gemfile CHANGED
@@ -1,4 +1,17 @@
1
- source "http://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in acts_as_votable.gemspec
4
4
  gemspec
5
+
6
+ rails_version = ENV['RAILS_VERSION'] || 'default'
7
+
8
+ rails = case rails_version
9
+ when 'master'
10
+ { :github => 'rails/rails'}
11
+ when 'default'
12
+ '~> 3.2.0'
13
+ else
14
+ "~> #{rails_version}"
15
+ end
16
+
17
+ gem 'rails', rails
data/README.markdown CHANGED
@@ -1,5 +1,7 @@
1
1
  # Acts As Votable (aka Acts As Likeable)
2
2
 
3
+ [![Build Status](https://travis-ci.org/ryanto/acts_as_votable.png)](https://travis-ci.org/ryanto/acts_as_votable)
4
+
3
5
  Acts As Votable is a Ruby Gem specifically written for Rails/ActiveRecord models.
4
6
  The main goals of this gem are:
5
7
 
@@ -11,11 +13,20 @@ The main goals of this gem are:
11
13
 
12
14
  ## Installation
13
15
 
14
- ### Rails 3+
16
+ ### Supported Ruby and Rails versions
17
+
18
+ * Ruby 1.8.7, 1.9.2, 1.9.3
19
+ * Ruby 2.0.0, 2.1.0
20
+ * Rails 3.0, 3.1, 3.2
21
+ * Rails 4.0, 4.1+
22
+
23
+ ### Install
15
24
 
16
25
  Just add the following to your Gemfile.
17
26
 
18
- gem 'acts_as_votable', '~> 0.5.0'
27
+ ```ruby
28
+ gem 'acts_as_votable', '~> 0.9.0'
29
+ ```
19
30
 
20
31
  And follow that up with a ``bundle install``.
21
32
 
@@ -35,81 +46,92 @@ caching section of this document for more information.
35
46
 
36
47
  ### Votable Models
37
48
 
38
- class Post < ActiveRecord::Base
39
- acts_as_votable
40
- end
49
+ ```ruby
50
+ class Post < ActiveRecord::Base
51
+ acts_as_votable
52
+ end
41
53
 
42
- @post = Post.new(:name => 'my post!')
43
- @post.save
54
+ @post = Post.new(:name => 'my post!')
55
+ @post.save
44
56
 
45
- @post.liked_by @user
46
- @post.votes.size # => 1
57
+ @post.liked_by @user
58
+ @post.votes_for.size # => 1
59
+ ```
47
60
 
48
61
  ### Like/Dislike Yes/No Up/Down
49
62
 
50
63
  Here are some voting examples. All of these calls are valid and acceptable. The
51
64
  more natural calls are the first few examples.
52
65
 
53
- @post.liked_by @user1
54
- @post.downvote_from @user2
55
- @post.vote :voter => @user3
56
- @post.vote :voter => @user4, :vote => 'bad'
57
- @post.vote :voter => @user5, :vote => 'like'
66
+ ```ruby
67
+ @post.liked_by @user1
68
+ @post.downvote_from @user2
69
+ @post.vote_by :voter => @user3
70
+ @post.vote_by :voter => @user4, :vote => 'bad'
71
+ @post.vote_by :voter => @user5, :vote => 'like'
72
+ ```
58
73
 
74
+ By default all votes are positive, so `@user3` has cast a 'good' vote for `@post`.
59
75
 
60
- By default all votes are positive, so @user3 has cast a 'good' vote for @post.
76
+ `@user1`, `@user3`, and `@user5` all voted in favor of `@post`.
61
77
 
62
- @user1, @user3, and @user5 all voted in favor of @post.
63
-
64
- @user2 and @user4 on the other had has voted against @post.
78
+ `@user2` and `@user4` on the other had has voted against `@post`.
65
79
 
66
80
 
67
81
  Just about any word works for casting a vote in favor or against post. Up/Down,
68
- Like/Dislike, Positive/Negative... the list goes on-and-on. Boolean flags ``true`` and
69
- ``false`` are also applicable.
82
+ Like/Dislike, Positive/Negative... the list goes on-and-on. Boolean flags `true` and
83
+ `false` are also applicable.
70
84
 
71
85
  Revisiting the previous example of code.
72
86
 
73
- # positive votes
74
- @post.liked_by @user1
75
- @post.vote :voter => @user3
76
- @post.vote :voter => @user5, :vote => 'like'
87
+ ```ruby
88
+ # positive votes
89
+ @post.liked_by @user1
90
+ @post.vote_by :voter => @user3
91
+ @post.vote_by :voter => @user5, :vote => 'like'
77
92
 
78
- # negative votes
79
- @post.downvote_from @user2
80
- @post.vote :voter => @user2, :vote => 'bad'
93
+ # negative votes
94
+ @post.downvote_from @user2
95
+ @post.vote_by :voter => @user2, :vote => 'bad'
81
96
 
82
- # tally them up!
83
- @post.votes.size # => 5
84
- @post.likes.size # => 3
85
- @post.upvotes.size # => 3
86
- @post.dislikes.size # => 2
87
- @post.downvotes.size # => 2
97
+ # tally them up!
98
+ @post.votes_for.size # => 5
99
+ @post.get_likes.size # => 3
100
+ @post.get_upvotes.size # => 3
101
+ @post.get_dislikes.size # => 2
102
+ @post.get_downvotes.size # => 2
103
+ ```
88
104
 
89
105
  Active Record scopes are provided to make life easier.
90
106
 
91
- @post.votes.up.by_type(User)
92
- @post.votes.down
93
- @user1.votes.up
94
- @user1.votes.down
95
- @user1.votes.up.by_type(Post)
107
+ ```ruby
108
+ @post.votes_for.up.by_type(User)
109
+ @post.votes_for.down
110
+ @user1.votes.up
111
+ @user1.votes.down
112
+ @user1.votes.up.by_type(Post)
113
+ ```
96
114
 
97
115
  Once scoping is complete, you can also trigger a get for the
98
116
  voter/votable
99
117
 
100
- @post.votes.up.by_type(User).voters
101
- @post.votes.down.by_type(User).voters
118
+ ```ruby
119
+ @post.votes_for.up.by_type(User).voters
120
+ @post.votes_for.down.by_type(User).voters
102
121
 
103
- @user.votes.up.for_type(Post).votables
104
- @user.votes.up.votables
122
+ @user.votes.up.for_type(Post).votables
123
+ @user.votes.up.votables
124
+ ```
105
125
 
106
126
  You can also 'unvote' a model to remove a previous vote.
107
127
 
108
- @post.liked_by @user1
109
- @post.unliked_by @user1
128
+ ```ruby
129
+ @post.liked_by @user1
130
+ @post.unliked_by @user1
110
131
 
111
- @post.disliked_by @user1
112
- @post.undisliked_by @user1
132
+ @post.disliked_by @user1
133
+ @post.undisliked_by @user1
134
+ ```
113
135
 
114
136
  Unvoting works for both positive and negative votes.
115
137
 
@@ -117,124 +139,168 @@ Unvoting works for both positive and negative votes.
117
139
 
118
140
  You can add an scope to your vote
119
141
 
120
- # positive votes
121
- @post.liked_by @user1, :vote_scope => 'rank'
122
- @post.vote :voter => @user3, :vote_scope => 'rank'
123
- @post.vote :voter => @user5, :vote => 'like', :vote_scope => 'rank'
124
-
125
- # negative votes
126
- @post.downvote_from @user2, :vote_scope => 'rank'
127
- @post.vote :voter => @user2, :vote => 'bad', :vote_scope => 'rank'
128
-
129
- # tally them up!
130
- @post.find_votes(:vote_scope => 'rank').size # => 5
131
- @post.likes(:vote_scope => 'rank').size # => 3
132
- @post.upvotes(:vote_scope => 'rank').size # => 3
133
- @post.dislikes(:vote_scope => 'rank').size # => 2
134
- @post.downvotes(:vote_scope => 'rank').size # => 2
135
-
136
- # votable model can be voted under different scopes
137
- # by the same user
138
- @post.vote :voter => @user1, :vote_scope => 'week'
139
- @post.vote :voter => @user1, :vote_scope => 'month'
140
-
141
- @post.votes.size # => 2
142
- @post.find_votes(:vote_scope => 'week').size # => 1
143
- @post.find_votes(:vote_scope => 'month').size # => 1
142
+ ```ruby
143
+ # positive votes
144
+ @post.liked_by @user1, :vote_scope => 'rank'
145
+ @post.vote_by :voter => @user3, :vote_scope => 'rank'
146
+ @post.vote_by :voter => @user5, :vote => 'like', :vote_scope => 'rank'
147
+
148
+ # negative votes
149
+ @post.downvote_from @user2, :vote_scope => 'rank'
150
+ @post.vote_by :voter => @user2, :vote => 'bad', :vote_scope => 'rank'
151
+
152
+ # tally them up!
153
+ @post.find_votes_for(:vote_scope => 'rank').size # => 5
154
+ @post.get_likes(:vote_scope => 'rank').size # => 3
155
+ @post.get_upvotes(:vote_scope => 'rank').size # => 3
156
+ @post.get_dislikes(:vote_scope => 'rank').size # => 2
157
+ @post.get_downvotes(:vote_scope => 'rank').size # => 2
158
+
159
+ # votable model can be voted under different scopes
160
+ # by the same user
161
+ @post.vote_by :voter => @user1, :vote_scope => 'week'
162
+ @post.vote_by :voter => @user1, :vote_scope => 'month'
163
+
164
+ @post.votes_for.size # => 2
165
+ @post.find_votes_for(:vote_scope => 'week').size # => 1
166
+ @post.find_votes_for(:vote_scope => 'month').size # => 1
167
+ ```
168
+ ### Adding weights to your votes
169
+
170
+ You can add weight to your vote. The default value is 1.
171
+
172
+ ```ruby
173
+ # positive votes
174
+ @post.liked_by @user1, :vote_weight => 1
175
+ @post.vote_by :voter => @user3, :vote_weight => 2
176
+ @post.vote_by :voter => @user5, :vote => 'like', :vote_scope => 'rank', :vote_weight => 3
177
+
178
+ # negative votes
179
+ @post.downvote_from @user2, :vote_scope => 'rank', :vote_weight => 1
180
+ @post.vote_by :voter => @user2, :vote => 'bad', :vote_scope => 'rank', :vote_weight => 3
181
+
182
+ # tally them up!
183
+ @post.find_votes_for(:vote_scope => 'rank').sum(:vote_weight) # => 6
184
+ @post.get_likes(:vote_scope => 'rank').sum(:vote_weight) # => 6
185
+ @post.get_upvotes(:vote_scope => 'rank').sum(:vote_weight) # => 6
186
+ @post.get_dislikes(:vote_scope => 'rank').sum(:vote_weight) # => 4
187
+ @post.get_downvotes(:vote_scope => 'rank').sum(:vote_weight) # => 4
188
+ ```
144
189
 
145
190
  ### The Voter
146
191
 
147
- You can have your voters ``acts_as_voter`` to provide some reserve functionality.
192
+ You can have your voters `acts_as_voter` to provide some reserve functionality.
148
193
 
149
- class User < ActiveRecord::Base
150
- acts_as_voter
151
- end
194
+ ```ruby
195
+ class User < ActiveRecord::Base
196
+ acts_as_voter
197
+ end
152
198
 
153
- @user.likes @article
199
+ @user.likes @article
154
200
 
155
- @article.votes.size # => 1
156
- @article.likes.size # => 1
157
- @article.dislikes.size # => 0
201
+ @article.votes.size # => 1
202
+ @article.likes.size # => 1
203
+ @article.dislikes.size # => 0
204
+ ```
158
205
 
159
206
  To check if a voter has voted on a model, you can use ``voted_for?``. You can
160
207
  check how the voter voted by using ``voted_as_when_voted_for``.
161
208
 
162
- @user.likes @comment1
163
- @user.up_votes @comment2
164
- # user has not voted on @comment3
209
+ ```ruby
210
+ @user.likes @comment1
211
+ @user.up_votes @comment2
212
+ # user has not voted on @comment3
165
213
 
166
- @user.voted_for? @comment1 # => true
167
- @user.voted_for? @comment2 # => true
168
- @user.voted_for? @comment3 # => false
214
+ @user.voted_for? @comment1 # => true
215
+ @user.voted_for? @comment2 # => true
216
+ @user.voted_for? @comment3 # => false
169
217
 
170
- @user.voted_as_when_voted_for @comment1 # => true, he liked it
171
- @user.voted_as_when_voted_for @comment2 # => false, he didnt like it
172
- @user.voted_as_when_voted_for @comment3 # => nil, he has yet to vote
218
+ @user.voted_as_when_voted_for @comment1 # => true, he liked it
219
+ @user.voted_as_when_voted_for @comment2 # => false, he didnt like it
220
+ @user.voted_as_when_voted_for @comment3 # => nil, he has yet to vote
221
+ ```
173
222
 
174
223
  You can also check whether the voter has voted up or down.
175
224
 
176
- @user.likes @comment1
177
- @user.dislikes @comment2
178
- # user has not voted on @comment3
225
+ ```ruby
226
+ @user.likes @comment1
227
+ @user.dislikes @comment2
228
+ # user has not voted on @comment3
179
229
 
180
- @user.voted_up_on? @comment1 # => true
181
- @user.voted_down_on? @comment1 # => false
230
+ @user.voted_up_on? @comment1 # => true
231
+ @user.voted_down_on? @comment1 # => false
182
232
 
183
- @user.voted_down_on? @comment2 # => true
184
- @user.voted_up_on? @comment2 # => false
233
+ @user.voted_down_on? @comment2 # => true
234
+ @user.voted_up_on? @comment2 # => false
185
235
 
186
- @user.voted_up_on? @comment3 # => false
187
- @user.voted_down_on? @comment3 # => false
236
+ @user.voted_up_on? @comment3 # => false
237
+ @user.voted_down_on? @comment3 # => false
238
+ ```
188
239
 
189
- Aliases for methods ``voted_up_on?`` and ``voted_down_on?`` are: ``voted_up_for?``, ``voted_down_for?``, ``liked?`` and ``disliked?``.
240
+ Aliases for methods `voted_up_on?` and `voted_down_on?` are: `voted_up_for?`, `voted_down_for?`, `liked?` and `disliked?`.
190
241
 
191
242
  Also, you can obtain a list of all the objects a user has voted for.
192
243
  This returns the actual objects instead of instances of the Vote model.
193
244
  All objects are eager loaded
194
245
 
195
- @user.find_voted_items
246
+ ```ruby
247
+ @user.find_voted_items
196
248
 
197
- @user.find_up_voted_items
198
- @user.find_liked_items
249
+ @user.find_up_voted_items
250
+ @user.find_liked_items
199
251
 
200
- @user.find_down_voted_items
201
- @user.find_disliked_items
252
+ @user.find_down_voted_items
253
+ @user.find_disliked_items
254
+ ```
202
255
 
203
256
  Members of an individual model that a user has voted for can also be
204
257
  displayed. The result is an ActiveRecord Relation.
205
258
 
206
- @user.get_voted Comment
259
+ ```ruby
260
+ @user.get_voted Comment
207
261
 
208
- @user.get_up_voted Comment
262
+ @user.get_up_voted Comment
209
263
 
210
- @user.get_down_voted Comment
264
+ @user.get_down_voted Comment
265
+ ```
211
266
 
212
267
  ### Registered Votes
213
268
 
214
269
  Voters can only vote once per model. In this example the 2nd vote does not count
215
- because @user has already voted for @shoe.
270
+ because `@user` has already voted for `@shoe`.
216
271
 
217
- @user.likes @shoe
218
- @user.likes @shoe
272
+ ```ruby
273
+ @user.likes @shoe
274
+ @user.likes @shoe
219
275
 
220
- @shoe.votes # => 1
221
- @shoe.likes # => 1
276
+ @shoe.votes # => 1
277
+ @shoe.likes # => 1
278
+ ```
222
279
 
223
- To check if a vote counted, or registered, use vote_registered? on your model
280
+ To check if a vote counted, or registered, use `vote_registered?` on your model
224
281
  after voting. For example:
225
282
 
226
- @hat.liked_by @user
227
- @hat.vote_registered? # => true
283
+ ```ruby
284
+ @hat.liked_by @user
285
+ @hat.vote_registered? # => true
286
+
287
+ @hat.liked_by => @user
288
+ @hat.vote_registered? # => false, because @user has already voted this way
228
289
 
229
- @hat.liked_by => @user
230
- @hat.vote_registered? # => false, because @user has already voted this way
290
+ @hat.disliked_by @user
291
+ @hat.vote_registered? # => true, because user changed their vote
231
292
 
232
- @hat.disliked_by @user
233
- @hat.vote_registered? # => true, because user changed their vote
293
+ @hat.votes.size # => 1
294
+ @hat.positives.size # => 0
295
+ @hat.negatives.size # => 1
296
+ ```
234
297
 
235
- @hat.votes.size # => 1
236
- @hat.positives.size # => 0
237
- @hat.negatives.size # => 1
298
+ To permit duplicates entries of a same voter, use option duplicate. Also notice that this
299
+ will limit some other methods that didn't deal with multiples votes, in this case, the last vote will be considered.
300
+
301
+ ```ruby
302
+ @hat.vote_by voter: @user, :duplicate => true
303
+ ```
238
304
 
239
305
  ## Caching
240
306
 
@@ -242,40 +308,74 @@ To speed up perform you can add cache columns to your votable model's table. Th
242
308
  columns will automatically be updated after each vote. For example, if we wanted
243
309
  to speed up @post we would use the following migration:
244
310
 
245
- class AddCachedVotesToPosts < ActiveRecord::Migration
246
- def self.up
247
- add_column :posts, :cached_votes_total, :integer, :default => 0
248
- add_column :posts, :cached_votes_score, :integer, :default => 0
249
- add_column :posts, :cached_votes_up, :integer, :default => 0
250
- add_column :posts, :cached_votes_down, :integer, :default => 0
251
- add_index :posts, :cached_votes_total
252
- add_index :posts, :cached_votes_score
253
- add_index :posts, :cached_votes_up
254
- add_index :posts, :cached_votes_down
255
- end
256
-
257
- def self.down
258
- remove_column :posts, :cached_votes_total
259
- remove_column :posts, :cached_votes_score
260
- remove_column :posts, :cached_votes_up
261
- remove_column :posts, :cached_votes_down
262
- end
263
- end
311
+ ```ruby
312
+ class AddCachedVotesToPosts < ActiveRecord::Migration
313
+ def self.up
314
+ add_column :posts, :cached_votes_total, :integer, :default => 0
315
+ add_column :posts, :cached_votes_score, :integer, :default => 0
316
+ add_column :posts, :cached_votes_up, :integer, :default => 0
317
+ add_column :posts, :cached_votes_down, :integer, :default => 0
318
+ add_column :posts, :cached_weighted_score, :integer, :default => 0
319
+ add_index :posts, :cached_votes_total
320
+ add_index :posts, :cached_votes_score
321
+ add_index :posts, :cached_votes_up
322
+ add_index :posts, :cached_votes_down
323
+ add_index :posts, :cached_weighted_score
324
+
325
+ # Uncomment this line to force caching of existing votes
326
+ # Post.find_each(&:update_cached_votes)
327
+ end
328
+
329
+ def self.down
330
+ remove_column :posts, :cached_votes_total
331
+ remove_column :posts, :cached_votes_score
332
+ remove_column :posts, :cached_votes_up
333
+ remove_column :posts, :cached_votes_down
334
+ remove_column :posts, :cached_weighted_score
335
+ end
336
+ end
337
+ ```
264
338
 
265
339
  ## Testing
266
340
 
267
- All tests follow the RSpec format and are located in the spec directory
341
+ All tests follow the RSpec format and are located in the spec directory.
342
+ They can be run with:
343
+
344
+ ```
345
+ rake spec
346
+ ```
347
+
348
+ ## Changes
349
+
350
+ ### Fixes for votable voter model
351
+
352
+ In version 0.8.0, there is bugs for a model that is both votable and voter.
353
+ Some name-conflicting methods are renamed:
354
+ + Renamed Votable.votes to votes_for
355
+ + Renamed Votable.vote to vote_by,
356
+ + Removed Votable.vote_by alias (was an alias for :vote_up)
357
+ + Renamed Votable.unvote_for to unvote_by
358
+ + Renamed Votable.find_votes to find_votes_for
359
+ + Renamed Votable.up_votes to get_upvotes
360
+ + and its aliases :get_true_votes, :get_ups, :get_upvotes, :get_likes, :get_positives, :get_for_votes
361
+ + Renamed Votable.down_votes to get_downvotes
362
+ + and its aliases :get_false_votes, :get_downs, :get_downvotes, :get_dislikes, :get_negatives
363
+
364
+
365
+ ## License
366
+
367
+ Acts as votable is released under the [MIT
368
+ License](http://www.opensource.org/licenses/MIT).
268
369
 
269
370
  ## TODO
270
371
 
271
372
  - Pass in a block of options when creating acts_as. Allow for things
272
373
  like disabling the aliasing
273
374
 
274
- - Smarter language syntax. Example: ``@user.likes`` will return all of the votables
275
- that the user likes, while ``@user.likes @model`` will cast a vote for @model by
375
+ - Smarter language syntax. Example: `@user.likes` will return all of the votables
376
+ that the user likes, while `@user.likes @model` will cast a vote for @model by
276
377
  @user.
277
378
 
278
- - Need to test a model that is votable as well as a voter
279
379
 
280
380
  - The aliased methods are referred to by using the terms 'up/down' and/or
281
381
  'true/false'. Need to come up with guidelines for naming these methods.
data/Rakefile CHANGED
@@ -1,2 +1,10 @@
1
1
  require 'bundler'
2
2
  Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+
6
+ desc "Run specs"
7
+ RSpec::Core::RakeTask.new(:spec)
8
+
9
+ desc 'Default: run specs.'
10
+ task :default => :spec
@@ -19,11 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
-
23
-
24
22
  s.add_development_dependency "rspec"
25
- s.add_development_dependency "sqlite3"
26
-
27
- s.add_dependency "rails", '>=3.0.0'
28
-
23
+ s.add_development_dependency "sqlite3", '1.3.7'
29
24
  end
@@ -0,0 +1,19 @@
1
+ module ActsAsVotable
2
+ module Extenders
3
+
4
+ module Controller
5
+
6
+ def voter_params(params_object = params[:vote])
7
+ params_object.permit(:votable_id, :votable_type,
8
+ :voter_id, :voter_type,
9
+ :votable, :voter,
10
+ :vote_flag, :vote_scope)
11
+ end
12
+
13
+ def votable_params(params_object = params[:vote])
14
+ params_object.permit(:vote_registered)
15
+ end
16
+
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module ActsAsVotable
2
- VERSION = "0.5.0"
2
+ VERSION = "0.9.0"
3
3
  end