Permalink
Browse files

User: experiment with a minimum karma required to downvote comments

  • Loading branch information...
jcs committed Nov 3, 2016
1 parent 1637ee8 commit 335e1fd0c43313c0ead7f3499b22e081f93e6c28
Showing with 4 additions and 2 deletions.
  1. +4 −2 app/models/user.rb
View
@@ -64,6 +64,9 @@ class User < ActiveRecord::Base
# minimum karma required to be able to offer title/tag suggestions
MIN_KARMA_TO_SUGGEST = 10
# minimum karma required to be able to downvote comments
MIN_KARMA_TO_DOWNVOTE = 100
# minimum karma required to be able to submit new stories
MIN_KARMA_TO_SUBMIT_STORIES = -4
@@ -174,8 +177,7 @@ def can_downvote?(obj)
return true
end
elsif obj.is_a?(Comment)
# XXX
return false
return !self.is_new? && (self.karma >= MIN_KARMA_TO_DOWNVOTE)

This comment has been minimized.

Show comment
Hide comment
@jkim-git

jkim-git Nov 11, 2016

Isn't is_new? already checked in line 170?

@jkim-git

jkim-git Nov 11, 2016

Isn't is_new? already checked in line 170?

This comment has been minimized.

Show comment
Hide comment
@jcs

jcs Nov 11, 2016

Contributor

yeah

@jcs

jcs Nov 11, 2016

Contributor

yeah

end
false

0 comments on commit 335e1fd

Please sign in to comment.