mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-07-23 02:54:40 +00:00
18 lines
378 B
Ruby
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
|