about summary refs log tree commit diff
path: root/app/models/stream_entry.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/stream_entry.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/stream_entry.rb')
-rw-r--r--app/models/stream_entry.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/stream_entry.rb b/app/models/stream_entry.rb
index fb349f35c..44aac39b3 100644
--- a/app/models/stream_entry.rb
+++ b/app/models/stream_entry.rb
@@ -25,6 +25,7 @@ class StreamEntry < ApplicationRecord
   STATUS_INCLUDES = [:account, :stream_entry, :conversation, :media_attachments, :tags, mentions: :account, reblog: [:stream_entry, :account, :conversation, :media_attachments, :tags, mentions: :account], thread: [:stream_entry, :account]].freeze
 
   default_scope { where(activity_type: 'Status') }
+  scope :recent, -> { reorder(id: :desc) }
   scope :with_includes, -> { includes(:account, status: STATUS_INCLUDES) }
 
   delegate :target, :title, :content, :thread,