For the record, here are my conditions:
In my case, a spammer must have:
- More than 1 post
- at least 1 titleless topic
- No titled topic
- The same number of posts as the number of topics (since a topic IS a post)
So I just added conditions:
User.find_each do |user|
untitled_topic_count = user.topics.where(title: "").count
titled_topic_count = user.topics.where.not(title: "").count
topic_count = untitled_topic_count + titled_topic_count
post_count = user.posts.count
if post_count > 1 && untitled_topic_count > 0 && titled_topic_count == 0 && post_count == topic_count
puts "SPAMMER ?"
end
end
Let’s hope that won’t target legit users, but that seems safe so far, looking randomly at targets. ![]()