increase janitor trial invites to 10/month

This commit is contained in:
r888888888
2015-08-14 14:02:00 -07:00
parent 6a02e4f3f3
commit 23ece16314

View File

@@ -27,7 +27,7 @@ class JanitorTrial < ActiveRecord::Base
def self.message_candidates!
admin = User.admins.first
User.where("last_logged_in_at >= ? and created_at <= ? and email is not null and (favorite_count >= 400 OR post_upload_count >= 400) and level between ? and ?", 1.week.ago, 6.months.ago, User::Levels::MEMBER, User::Levels::CONTRIBUTOR).order("random()").limit(5).each do |user|
User.where("last_logged_in_at >= ? and created_at <= ? and email is not null and (favorite_count >= 400 OR post_upload_count >= 400) and level between ? and ?", 1.week.ago, 6.months.ago, User::Levels::MEMBER, User::Levels::CONTRIBUTOR).order("random()").limit(10).each do |user|
if !Dmail.where("from_id = ? and to_id = ? and title = ?", admin.id, user.id, "Test Janitor Invitation").exists?
favorites = user.favorites.order("random()").limit(400).map(&:post_id)
uploads = user.posts.order("random()").limit(400).map(&:id)