mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-25 07:58:07 +08:00
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.
9 lines
183 B
Ruby
Vendored
9 lines
183 B
Ruby
Vendored
# 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
|