Commit 7855b2c3 authored by Carl Chenet's avatar Carl Chenet

Story: move minimum score to a constant, like Comment has

parent 653d8e64
......@@ -33,6 +33,9 @@ class Story < ActiveRecord::Base
DOWNVOTABLE_DAYS = 14
# the lowest a score can go
DOWNVOTABLE_MIN_SCORE = -5
# after this many minutes old, a story cannot be edited
MAX_EDIT_MINS = (60 * 6)
......@@ -381,7 +384,7 @@ class Story < ActiveRecord::Base
end
def is_downvotable?
if self.created_at && self.score >= -5
if self.created_at && self.score >= DOWNVOTABLE_MIN_SCORE
Time.now - self.created_at <= DOWNVOTABLE_DAYS.days
else
false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment