Files
gitlabhq/lib/banzai/filter.rb
2025-07-11 18:12:53 +00:00

18 lines
378 B
Ruby

# frozen_string_literal: true
module Banzai
module Filter
# The maximum number of items that a filter should allow,
# such as emojis, etc.
FILTER_ITEM_LIMIT = 1000
def self.[](name)
const_get("#{name.to_s.camelize}Filter", false)
end
def self.filter_item_limit_exceeded?(count, limit: FILTER_ITEM_LIMIT)
count >= limit
end
end
end