about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-07-23 01:15:04 +0200
committerGitHub <noreply@github.com>2017-07-23 01:15:04 +0200
commit7964bfccdb0bc30c4f15db092b66a6f8d57f1262 (patch)
tree14e62b1f8bf1185b49f26bae49bf2b60dac4382f /app/models
parent3c515f2cd2a636e06c2cdf67d3493671134b6839 (diff)
Add rake task mastodon:feeds:build to regenerate all active users' feeds (#4303)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 25dc25864..96a2d09b7 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -53,6 +53,7 @@ class User < ApplicationRecord
   scope :admins,    -> { where(admin: true) }
   scope :confirmed, -> { where.not(confirmed_at: nil) }
   scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) }
+  scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where(accounts: { suspended: false }) }
   scope :matches_email, ->(value) { where(arel_table[:email].matches("#{value}%")) }
   scope :with_recent_ip_address, ->(value) { where(arel_table[:current_sign_in_ip].eq(value).or(arel_table[:last_sign_in_ip].eq(value))) }