Fix #99 - public timeline not just reblogs, fix #98 infinite scrolling issues

This commit is contained in:
Eugen Rochko 2016-10-17 01:23:41 +02:00
parent 13ee88926d
commit b5c6d00afa
4 changed files with 8 additions and 7 deletions

View file

@ -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