peteonrails-vote_fu 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -171,12 +171,22 @@ There will be a screencast coming soon too. Contact me if you want to help.
171
171
  Consideration
172
172
  =============
173
173
  If you like this software and use it, please consider recommending me on Working With Rails.
174
+
174
175
  I don't want donations: a simple up-vote would make my day. My profile is: [http://www.workingwithrails.com/person/12521-peter-jackson][4]
176
+
175
177
  To go directly to the "Recommend Me" screen: [http://www.workingwithrails.com/recommendation/new/person/12521-peter-jackson][5]
176
178
 
177
179
 
178
180
  Credits
179
- _______
181
+ =======
182
+
183
+ #### Contributors
184
+
185
+ * Bence Nagy, Budapest, Hungary
186
+ * Jon Maddox, Richmond, Virginia, USA
187
+
188
+ #### Other works
189
+
180
190
  [Juixe - The original ActsAsVoteable plugin inspired this code.][1]
181
191
 
182
192
  [Xelipe - This plugin is heavily influenced by Acts As Commentable.][2]
@@ -185,12 +195,16 @@ _______
185
195
  [2]: http://github.com/jackdempsey/acts_as_commentable/tree/master
186
196
 
187
197
  More
188
- ____
198
+ ====
199
+
200
+ Support: [Use my blog for support.][6]
201
+
189
202
 
190
203
  [Documentation from the original acts\_as\_voteable plugin][3]
191
204
 
192
205
  [3]: http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/
193
206
  [4]: http://www.workingwithrails.com/person/12521-peter-jackson
194
207
  [5]: http://www.workingwithrails.com/recommendation/new/person/12521-peter-jackson
208
+ [6]: http://blog.peteonrails.com
195
209
 
196
210
  Copyright (c) 2008 Peter Jackson, released under the MIT license
data/lib/acts_as_voter.rb CHANGED
@@ -65,9 +65,7 @@ module PeteOnRails
65
65
  end
66
66
 
67
67
  def vote(voteable, vote)
68
- vote = Vote.new(:vote => vote)
69
- voteable.votes << vote
70
- self.votes << vote
68
+ vote = Vote.new(:vote => vote, :voteable => voteable, :voter => self)
71
69
  vote.save
72
70
  end
73
71
 
data/lib/models/vote.rb CHANGED
@@ -9,7 +9,7 @@ class Vote < ActiveRecord::Base
9
9
  belongs_to :voteable, :polymorphic => true
10
10
  belongs_to :voter, :polymorphic => true
11
11
 
12
- attr_accessible :vote
12
+ attr_accessible :vote, :voter, :voteable
13
13
 
14
14
  # Uncomment this to limit users to a single vote on each item.
15
15
  # validates_uniqueness_of :voteable_id, :scope => [:voteable_type, :voter_type, :voter_id]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peteonrails-vote_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Jackson