about summary refs log tree commit diff
path: root/app/models/concerns
diff options
context:
space:
mode:
authorJenkins <jenkins@jenkins.ninjawedding.org>2018-05-31 01:17:25 +0000
committerJenkins <jenkins@jenkins.ninjawedding.org>2018-05-31 01:17:25 +0000
commit165b5dc7f5711efd07adb73316e94d89b9e7e3a3 (patch)
treeeafd267dd5b167961455e24bbdba89b025563177 /app/models/concerns
parente7b3a4263e5a22a64b7fdc3a965fa38e1935157a (diff)
parentc61c4565ab17f7e882b93f96e4d97ff1681a7bcf (diff)
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/account_interactions.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/concerns/account_interactions.rb b/app/models/concerns/account_interactions.rb
index a064248d9..d067415fd 100644
--- a/app/models/concerns/account_interactions.rb
+++ b/app/models/concerns/account_interactions.rb
@@ -187,4 +187,15 @@ module AccountInteractions
   def pinned?(status)
     status_pins.where(status: status).exists?
   end
+
+  def followers_for_local_distribution
+    followers.local
+             .joins(:user)
+             .where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago)
+  end
+
+  def lists_for_local_distribution
+    lists.joins(account: :user)
+         .where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago)
+  end
 end