Fix Status.permitted_for scope query

lolsob-rspec
Eugen Rochko 2017-02-11 19:16:10 +01:00
parent db53bfd30e
commit c001ef3df6
1 changed files with 1 additions and 2 deletions

View File

@ -158,8 +158,7 @@ class Status < ApplicationRecord
elsif !account.nil? && target_account.blocking?(account) elsif !account.nil? && target_account.blocking?(account)
where('1 = 0') where('1 = 0')
elsif !account.nil? elsif !account.nil?
joins('LEFT OUTER JOIN mentions ON statuses.id = mentions.status_id') joins('LEFT OUTER JOIN mentions ON statuses.id = mentions.status_id AND mentions.account_id = ' + account.id.to_s)
.where('mentions.account_id = ?', account.id)
.where('statuses.visibility != ? OR mentions.id IS NOT NULL', Status.visibilities[:private]) .where('statuses.visibility != ? OR mentions.id IS NOT NULL', Status.visibilities[:private])
else else
where.not(visibility: :private) where.not(visibility: :private)