Adjust badge streak copy (#2467)

This commit is contained in:
Ben Halpern 2019-04-16 16:41:16 -04:00 committed by GitHub
parent 9be054d3dc
commit d45f2c5898
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,7 +57,11 @@ module BadgeRewarder
def self.award_streak_badge(num_weeks)
article_user_ids = Article.published.where("published_at > ? AND score > ?", 1.week.ago, -25).pluck(:user_id) # No cred for super low quality
message = "Congrats on achieving this streak! Consistent writing is hard. The next streak badge you can get is the #{num_weeks * 2} Week Badge. 😉"
message = if num_weeks == 16
"16 weeks! You've achieved the longest DEV writing streak possible. This makes you eligible for special quests in the future. Keep up the amazing contributions to our community!"
else
"Congrats on achieving this streak! Consistent writing is hard. The next streak badge you can get is the #{num_weeks * 2} Week Badge. 😉"
end
users = User.where(id: article_user_ids).where("articles_count >= ?", num_weeks)
usernames = []
users.find_each do |user|