about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/paginable.rb4
-rw-r--r--app/models/status.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/concerns/paginable.rb b/app/models/concerns/paginable.rb
index 2d35d349f..0a542d534 100644
--- a/app/models/concerns/paginable.rb
+++ b/app/models/concerns/paginable.rb
@@ -4,8 +4,8 @@ module Paginable
   included do
     def self.paginate_by_max_id(limit, max_id = nil, since_id = nil)
       query = order('id desc').limit(limit)
-      query = query.where('id < ?', max_id) unless max_id.blank?
-      query = query.where('id > ?', since_id) unless since_id.blank?
+      query = query.where(arel_table[:id].lt(max_id)) unless max_id.blank?
+      query = query.where(arel_table[:id].gt(since_id)) unless since_id.blank?
       query
     end
   end
diff --git a/app/models/status.rb b/app/models/status.rb
index 58b2cb1f3..f2935fea9 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -86,7 +86,7 @@ class Status < ApplicationRecord
   end
 
   def self.as_public_timeline(account)
-    joins('LEFT JOIN statuses AS reblogs ON reblogs.id = statuses.reblog_of_id').where('reblogs.account_id NOT IN (SELECT target_account_id FROM blocks WHERE account_id = ?) AND statuses.account_id NOT IN (SELECT target_account_id FROM blocks WHERE account_id = ?)', account.id, account.id).with_includes.with_counters
+    joins('LEFT OUTER JOIN statuses AS reblogs ON reblogs.id = statuses.reblog_of_id').where('reblogs.account_id NOT IN (SELECT target_account_id FROM blocks WHERE account_id = ?) AND statuses.account_id NOT IN (SELECT target_account_id FROM blocks WHERE account_id = ?)', account.id, account.id).with_includes.with_counters
   end
 
   def self.favourites_map(status_ids, account_id)