diff --git a/app/models/category.rb b/app/models/category.rb index a020533a9..10cfe3e86 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -25,6 +25,7 @@ # index_categories_on_slug_and_locale_and_portal_id (slug,locale,portal_id) UNIQUE # class Category < ApplicationRecord + paginates_per Limits::CATEGORIES_PER_PAGE belongs_to :account belongs_to :portal has_many :folders, dependent: :destroy_async diff --git a/lib/limits.rb b/lib/limits.rb index b6b449d0d..5a50f2f8f 100644 --- a/lib/limits.rb +++ b/lib/limits.rb @@ -4,6 +4,7 @@ module Limits URL_LENGTH_LIMIT = 2048 # https://stackoverflow.com/questions/417142 OUT_OF_OFFICE_MESSAGE_MAX_LENGTH = 10_000 GREETING_MESSAGE_MAX_LENGTH = 10_000 + CATEGORIES_PER_PAGE = 1000 def self.conversation_message_per_minute_limit ENV.fetch('CONVERSATION_MESSAGE_PER_MINUTE_LIMIT', '200').to_i