Permalink
Browse files

changed conditional to include 0 vote

  • Loading branch information...
1 parent 5770b74 commit e7ef9f0b69a0a7804f4ee6c9731375b9f617958f @joeellis committed Jan 23, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/acts_as_voteable.rb
View
@@ -110,7 +110,7 @@ def tally(*args)
# with multiple 'having' clauses. So we hack them all into one for now.
# If you have a more elegant solution, a pull request on Github would be greatly appreciated.
t = t.having([
- "#{vote_count} > 0",
+ "#{vote_count} >= 0",
(options[:at_least] ? "#{vote_count} >= #{sanitize(options[:at_least])}" : nil),
(options[:at_most] ? "#{vote_count} <= #{sanitize(options[:at_most])}" : nil)
].compact.join(' AND '))

0 comments on commit e7ef9f0

Please sign in to comment.