diff options
Diffstat (limited to 'app/models/tweet.rb')
-rw-r--r-- | app/models/tweet.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/tweet.rb b/app/models/tweet.rb index 3123d25..96795cb 100644 --- a/app/models/tweet.rb +++ b/app/models/tweet.rb @@ -13,6 +13,7 @@ class Tweet < ActiveRecord::Base scope :recent, ->(days = 3) { where("tweets.id > ?", snowflake_min(Time.zone.now - days.days)) } scope :reacted, ->(count = nil) { where("reactions_count >= ?", (count || 1).to_i) } scope :not_protected, -> { includes(:user).references(:user).where(users: { protected: false }) } + scope :registered, -> { joins(user: :account).references(:account).where(accounts: { status: Account::ACTIVE }) } scope :max_id, -> id { where("tweets.id <= ?", id.to_i) if id } scope :since_id, -> id { where("tweets.id > ?", id.to_i) if id } |