|
@ -20,4 +20,16 @@ class AccountStat < ApplicationRecord |
|
|
belongs_to :account, inverse_of: :account_stat |
|
|
belongs_to :account, inverse_of: :account_stat |
|
|
|
|
|
|
|
|
update_index('accounts', :account) |
|
|
update_index('accounts', :account) |
|
|
|
|
|
|
|
|
|
|
|
def following_count |
|
|
|
|
|
[attributes['following_count'], 0].max |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def followers_count |
|
|
|
|
|
[attributes['followers_count'], 0].max |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def statuses_count |
|
|
|
|
|
[attributes['statuses_count'], 0].max |
|
|
|
|
|
end |
|
|
end |
|
|
end |