app/models/trust_level3_requirements.rb:
user.user_visits.where('visited_at > ?', time_period.days.ago).pluck(:posts_read).sum
app/models/trust_level3_requirements.rb: user.user_visits.pluck(:posts_read).sum
could be changed to
user.user_visits.where('visited_at > ?', time_period.days.ago).sum(:posts_read)
user.user_visits.sum(:posts_read)
since doing sum directly under db is faster than pluck and sum