discourse/plugins/chat
David Taylor 54cae1299e
DEV: Do not attempt to overwrite UserOption enums during autoloading (#22150)
Unfortunately, Discourse's `UserOption` model is not currently autoloaded. That means that modifying it via a `reloadable_patch` will try to apply the changes repeatedly. Normally this doesn't matter since the changes are idempotent. However, introducing ActiveRecord enums is not idempotent - they raise an error if the same enum already exists on the model. This commit adds a check to avoid hitting this 'duplicate definition' error.

Reproduced

```
rails runner 'Rails.application.reloader.reload!'
```
2023-06-16 12:29:32 +01:00
..
app FEATURE: Allow users to manually track threads without replying (#22100) 2023-06-16 12:08:26 +10:00
assets FIX: css class was incorrect (#22149) 2023-06-16 12:33:13 +02:00
config FEATURE: Allow users to manually track threads without replying (#22100) 2023-06-16 12:08:26 +10:00
db FIX: Backfill chat thread memberships (#21971) 2023-06-14 13:54:51 +10:00
lib DEV: Do not attempt to overwrite UserOption enums during autoloading (#22150) 2023-06-16 12:29:32 +01:00
public
spec FIX: various mobile chat improvements (#22132) 2023-06-16 11:36:43 +02:00
test/javascripts FIX: various mobile chat improvements (#22132) 2023-06-16 11:36:43 +02:00
plugin.rb FIX: Chat NotificationLevels extension breaking in prod (#21484) 2023-05-10 18:46:06 +02:00
README.md DEV: Chat service object initial implementation (#19814) 2023-02-13 13:09:57 +01:00

This plugin is still in active development and may change frequently

Documentation

The Discourse Chat plugin adds chat functionality to your Discourse so it can natively support both long-form and short-form communication needs of your online community.

For user documentation, see Discourse Chat.

For developer documentation, see Discourse Documentation.