mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:16:38 -06:00
REFACTOR: remove where conditions array with only 1 item
This commit is contained in:
parent
705c898c21
commit
b8d5f8d29d
@ -76,18 +76,13 @@ class AdminUserIndexQuery
|
||||
end
|
||||
|
||||
def suspect_users
|
||||
where_conds = []
|
||||
|
||||
# One signal: no reading yet the user has bio text
|
||||
where_conds << "user_stats.posts_read_count <= 1 AND user_stats.topics_entered <= 1"
|
||||
|
||||
@query.activated
|
||||
@query
|
||||
.activated
|
||||
.human_users
|
||||
.references(:user_stats)
|
||||
.includes(:user_profile)
|
||||
.where("COALESCE(user_profiles.bio_raw, '') != ''")
|
||||
.where('users.created_at <= ?', 1.day.ago)
|
||||
.where(where_conds.map { |c| "(#{c})" }.join(" OR "))
|
||||
.joins(:user_profile, :user_stat)
|
||||
.where("users.created_at <= ?", 1.day.ago)
|
||||
.where("LENGTH(COALESCE(user_profiles.bio_raw, '')) > 0")
|
||||
.where("user_stats.posts_read_count <= 1 AND user_stats.topics_entered <= 1")
|
||||
end
|
||||
|
||||
def filter_by_query_classification
|
||||
|
Loading…
Reference in New Issue
Block a user