peteonrails-vote_fu 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/acts_as_voter.rb +4 -4
- metadata +1 -1
data/lib/acts_as_voter.rb
CHANGED
@@ -37,15 +37,15 @@ module PeteOnRails
|
|
37
37
|
|
38
38
|
def voted_for?(voteable)
|
39
39
|
0 < Vote.count(:all, :conditions => [
|
40
|
-
"voter_id = ? AND voter_type = ? AND vote =
|
41
|
-
self.id, self.class.name, voteable.id, voteable.class.name
|
40
|
+
"voter_id = ? AND voter_type = ? AND vote = ? AND voteable_id = ? AND voteable_type = ?",
|
41
|
+
self.id, self.class.name, true, voteable.id, voteable.class.name
|
42
42
|
])
|
43
43
|
end
|
44
44
|
|
45
45
|
def voted_against?(voteable)
|
46
46
|
0 < Vote.count(:all, :conditions => [
|
47
|
-
"voter_id = ? AND voter_type = ? AND vote =
|
48
|
-
self.id, self.class.name, voteable.id, voteable.class.name
|
47
|
+
"voter_id = ? AND voter_type = ? AND vote = ? AND voteable_id = ? AND voteable_type = ?",
|
48
|
+
self.id, self.class.name, false, voteable.id, voteable.class.name
|
49
49
|
])
|
50
50
|
end
|
51
51
|
|