about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-11 19:16:10 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-11 19:16:10 +0100
commit31c633e528393e4b3ebfdf89d48d50bbe53f7104 (patch)
treed44ddeb596e20c966c0d693a54b118f111f8adbe /app/models
parent50660d54e8cabd08fee649a6abc26f35a8d7a82c (diff)
Fix Status.permitted_for scope query
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 93594ec8f..e440bbaca 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -158,8 +158,7 @@ class Status < ApplicationRecord
       elsif !account.nil? && target_account.blocking?(account)
         where('1 = 0')
       elsif !account.nil?
-        joins('LEFT OUTER JOIN mentions ON statuses.id = mentions.status_id')
-          .where('mentions.account_id = ?', account.id)
+        joins('LEFT OUTER JOIN mentions ON statuses.id = mentions.status_id AND mentions.account_id = ' + account.id.to_s)
           .where('statuses.visibility != ? OR mentions.id IS NOT NULL', Status.visibilities[:private])
       else
         where.not(visibility: :private)