From 5fc517473f38cd6df278599e25cd008e105fe7d7 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 12 Aug 2020 17:40:46 -0500 Subject: [PATCH] Removed limits for pagination in GroupCollectionController, GroupTimeline controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Removed: - limits for pagination in GroupCollectionController, GroupTimeline controller --- .../api/v1/timelines/group_collection_controller.rb | 4 +--- app/controllers/api/v1/timelines/group_controller.rb | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/v1/timelines/group_collection_controller.rb b/app/controllers/api/v1/timelines/group_collection_controller.rb index 6fd59671..b08d0c90 100644 --- a/app/controllers/api/v1/timelines/group_collection_controller.rb +++ b/app/controllers/api/v1/timelines/group_collection_controller.rb @@ -6,7 +6,7 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController before_action :set_statuses after_action :insert_pagination_headers, unless: -> { - @statuses.empty? || @statuses.length < DEFAULT_STATUSES_LIMIT + @statuses.empty? } def show @@ -94,8 +94,6 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController if @sort_type == 'newest' statuses = Status.where( group: @groupIds, reply: false - ).where( - 'statuses.created_at > ?', 14.days.ago ).paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), params_slice(:max_id, :since_id, :min_id) diff --git a/app/controllers/api/v1/timelines/group_controller.rb b/app/controllers/api/v1/timelines/group_controller.rb index c41ab47f..dd726d9f 100644 --- a/app/controllers/api/v1/timelines/group_controller.rb +++ b/app/controllers/api/v1/timelines/group_controller.rb @@ -6,7 +6,7 @@ class Api::V1::Timelines::GroupController < Api::BaseController before_action :set_statuses after_action :insert_pagination_headers, unless: -> { - @statuses.empty? || @statuses.length < DEFAULT_STATUSES_LIMIT + @statuses.empty? } def show @@ -74,8 +74,6 @@ class Api::V1::Timelines::GroupController < Api::BaseController if @sort_type == 'newest' statuses = Status.where( group: @group, reply: false - ).where( - 'statuses.created_at > ?', 14.days.ago ).paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), params_slice(:max_id, :since_id, :min_id)