Cover AccountsController more in spec (#3229)
* Introduce recent scope to Status and StreamEntry Introduce recent scope to Status and StreamEntry as Account has. * Cover AccountsController more in AccountsController
This commit is contained in:
parent
9afd7dadbf
commit
8fd174298d
4 changed files with 38 additions and 9 deletions
|
@ -55,8 +55,9 @@ class Status < ApplicationRecord
|
|||
validates_with StatusLengthValidator
|
||||
validates :reblog, uniqueness: { scope: :account }, if: :reblog?
|
||||
|
||||
default_scope { order(id: :desc) }
|
||||
default_scope { recent }
|
||||
|
||||
scope :recent, -> { reorder(id: :desc) }
|
||||
scope :remote, -> { where.not(uri: nil) }
|
||||
scope :local, -> { where(uri: nil) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue