change daily flag limit to 5/day

This commit is contained in:
r888888888
2017-03-16 14:32:04 -07:00
parent d9a26975ba
commit e7b3fae215
3 changed files with 36 additions and 8 deletions

View File

@@ -95,12 +95,10 @@ class PostFlag < ActiveRecord::Base
end
def validate_creator_is_not_limited
if CurrentUser.can_approve_posts?
# do nothing
elsif creator.created_at > 1.week.ago
if creator.created_at > 1.week.ago
errors[:creator] << "cannot flag within the first week of sign up"
elsif creator.is_gold? && flag_count_for_creator >= 10
errors[:creator] << "can flag 10 posts a day"
elsif creator.is_gold? && flag_count_for_creator >= 5
errors[:creator] << "can flag 5 posts a day"
elsif !creator.is_gold? && flag_count_for_creator >= 1
errors[:creator] << "can flag 1 post a day"
end