about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-22 23:18:54 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-22 23:18:54 +0100
commit5c78547198de20e7f367adb142acc82cd80b4899 (patch)
tree18df6af1dc5042e44c67156586822bd8798f6c84 /app/models/status.rb
parentfc90d38893ae81b83884c3f5c85d05d564f1de33 (diff)
More query optimizations
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 53987c3ec..708fef17f 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -4,7 +4,7 @@ class Status < ApplicationRecord
   include Paginable
   include Streamable
 
-  belongs_to :account, -> { with_counters }, inverse_of: :statuses
+  belongs_to :account, inverse_of: :statuses
 
   belongs_to :thread, foreign_key: 'in_reply_to_id', class_name: 'Status', inverse_of: :replies
   belongs_to :reblog, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblogs, touch: true
@@ -27,7 +27,7 @@ class Status < ApplicationRecord
   default_scope { order('id desc') }
 
   scope :with_counters, -> { select('statuses.*, (select count(r.id) from statuses as r where r.reblog_of_id = statuses.id) as reblogs_count, (select count(f.id) from favourites as f where f.status_id = statuses.id) as favourites_count') }
-  scope :with_includes, -> { includes(:account, :media_attachments, :tags, :stream_entry, mentions: :account, reblog: [:account, mentions: :account], thread: :account) }
+  scope :with_includes, -> { includes(:account, :media_attachments, :tags, :stream_entry, mentions: :account, reblog: [:account, :stream_entry, :tags, mentions: :account], thread: :account) }
 
   def local?
     uri.nil?