0
0
Fork 0

Moving Salmon notifications to background processing, fixing mini-profiler

behaviour with Turbolinks enabled, optimizing Rabl for production
This commit is contained in:
Eugen Rochko 2016-03-26 13:42:10 +01:00
parent da4b675aca
commit 85b00d19b8
15 changed files with 49 additions and 35 deletions

View file

@ -17,7 +17,7 @@ class Status < ActiveRecord::Base
validates :text, presence: true, if: Proc.new { |s| s.local? && !s.reblog? }
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, :mentions, :stream_entry, reblog: [:account, :mentions], thread: [:account, :mentions]) }
scope :with_includes, -> { includes(:account, :mentions, :stream_entry, reblog: [:account, :mentions], thread: :account) }
def local?
self.uri.nil?