kandadaboggu-vote_fu 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ 2010-03-08
2
+ ==========
3
+ * Vote method in `acts_as_voter` model returns true upon success.
4
+
1
5
  2010-02-21
2
6
  ==========
3
7
  * Changed the `tally` method to add support for `at_least_total` and `at_most_total` parameters to filter by sum of votes.
@@ -148,8 +148,8 @@ module Juixe
148
148
  end
149
149
 
150
150
  def voted_by?(voter, for_or_against = "all")
151
- options = {:vote => (for_or_against ? 1 : -1)} unless (for_or_against == "all")
152
- self.votes.exists?({:voter_id => voter.id, :voter_type => voter.class.name}.merge(options||{}))
151
+ options = (for_or_against == "all") ? {} : {:vote => (for_or_against ? 1 : -1)}
152
+ self.votes.exists?({:voter_id => voter.id, :voter_type => voter.class.name}.merge(options))
153
153
  end
154
154
  end
155
155
  end
@@ -54,7 +54,7 @@ module PeteOnRails
54
54
  def vote(voteable, vote)
55
55
  Vote.create(:vote => vote, :voteable => voteable, :voter => self).tap do |v|
56
56
  voteable.reload_vote_counter if !v.new_record? and voteable.respond_to?(:reload_vote_counter)
57
- end
57
+ end.errors.empty?
58
58
  end
59
59
 
60
60
  end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kandadaboggu-vote_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 15
9
+ version: 0.0.15
5
10
  platform: ruby
6
11
  authors:
7
12
  - Peter Jackson
@@ -13,7 +18,7 @@ autorequire:
13
18
  bindir: bin
14
19
  cert_chain: []
15
20
 
16
- date: 2010-02-20 00:00:00 -08:00
21
+ date: 2010-03-08 00:00:00 -08:00
17
22
  default_executable:
18
23
  dependencies: []
19
24
 
@@ -61,18 +66,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
66
  requirements:
62
67
  - - ">="
63
68
  - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
64
71
  version: "0"
65
- version:
66
72
  required_rubygems_version: !ruby/object:Gem::Requirement
67
73
  requirements:
68
74
  - - ">="
69
75
  - !ruby/object:Gem::Version
76
+ segments:
77
+ - 0
70
78
  version: "0"
71
- version:
72
79
  requirements: []
73
80
 
74
81
  rubyforge_project:
75
- rubygems_version: 1.3.5
82
+ rubygems_version: 1.3.6
76
83
  signing_key:
77
84
  specification_version: 3
78
85
  summary: Enhanced vote_fu with numerical voting and total vote caching.