From 58b3f4fd674d29c444b236ad3936dbd04c6e175e Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 2 Dec 2016 14:14:49 +0100 Subject: Fix #329 - avatar errors no longer prevent remote accounts from being saved (without avatar). Also improved search position of exact matches --- app/models/status.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models/status.rb') diff --git a/app/models/status.rb b/app/models/status.rb index 87d8249b1..1a37ea86f 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -29,7 +29,8 @@ 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 :remote, -> { where.not(uri: nil) } + scope :local, -> { where(uri: nil) } cache_associated :account, :media_attachments, :tags, :stream_entry, mentions: :account, reblog: [:account, :stream_entry, :tags, :media_attachments, mentions: :account], thread: :account -- cgit