diff options
author | rhenium <rhenium@rhe.jp> | 2014-05-05 08:36:51 +0900 |
---|---|---|
committer | rhenium <rhenium@rhe.jp> | 2014-05-05 08:36:51 +0900 |
commit | 6950f9fb396667f35c09b32eb3ced44708199521 (patch) | |
tree | 87702e5a0dc2e682255494af164b31d01396e9ca /app/models/tweet.rb | |
parent | f19b85a79176395ed1d97022455984818b72e30b (diff) | |
download | aclog-6950f9fb396667f35c09b32eb3ced44708199521.tar.gz |
use Rails 4.1's enum
Diffstat (limited to 'app/models/tweet.rb')
-rw-r--r-- | app/models/tweet.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/tweet.rb b/app/models/tweet.rb index d42576f..ce3e922 100644 --- a/app/models/tweet.rb +++ b/app/models/tweet.rb @@ -15,7 +15,7 @@ class Tweet < ActiveRecord::Base scope :recent, ->(period = 3.days) { where("tweets.id > ?", snowflake_min(Time.zone.now - period)) } scope :reacted, ->(count = nil) { where("reactions_count >= ?", (count || 1).to_i) } scope :not_protected, -> { joins(:user).references(:user).where(users: { protected: false }) } - scope :registered, -> { joins(user: :account).references(:account).where(accounts: { status: Account::ACTIVE }) } + scope :registered, -> { joins(user: :account).references(:account).merge(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 } |