about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-05-23 09:53:01 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-05-23 02:53:01 +0200
commit8fd174298df3fea60a4efe958fca9c1946633e10 (patch)
tree21e2ddcbc759039c181116e23c577cb362f12fcf /app/models/status.rb
parent9afd7dadbf5ffa6ad0686da197b927230a101bea (diff)
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
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index d7304152f..a3dbce9f1 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -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) }