voteable_dave_jul 0.0.0 → 0.0.1
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.
- data/lib/voteable_dave_jul.rb +3 -3
- metadata +1 -1
data/lib/voteable_dave_jul.rb
CHANGED
@@ -11,15 +11,15 @@ module VoteableDaveJul
|
|
11
11
|
|
12
12
|
# handles counting votes for comments and posts
|
13
13
|
def total_votes
|
14
|
-
up_votes - down_votes
|
14
|
+
self.up_votes - self.down_votes
|
15
15
|
end
|
16
16
|
|
17
17
|
def up_votes
|
18
|
-
votes.where(vote: true).size
|
18
|
+
self.votes.where(vote: true).size
|
19
19
|
end
|
20
20
|
|
21
21
|
def down_votes
|
22
|
-
votes.where(vote: false).size
|
22
|
+
self.votes.where(vote: false).size
|
23
23
|
end
|
24
24
|
|
25
25
|
# module ClassMethods
|