discourse/plugins/chat/lib/chat/notification_levels.rb
Martin Brennan 616885895a
FIX: Chat NotificationLevels extension breaking in prod (#21484)
When setting DISCOURSE_ZEITWERK_EAGER_LOAD=1 to enable
eager loading the previous solution to adding chat_levels
to the core NotificationLevels would break with a module
loading error (c.f. cc2570fce3)

We don't actually _need_ to extend the core class, we can just
make our own for chat, let's do this instead.
2023-05-10 18:46:06 +02:00

10 lines
183 B
Ruby

# frozen_string_literal: true
module Chat
class NotificationLevels
def self.all
@all_levels ||= Enum.new(muted: 0, normal: 1, tracking: 2, watching: 3)
end
end
end