mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 08:15:41 +08:00

`add_class_method` can be used to add a class method that only executes when the plugin is enabled. `add_model_callback` can be used to attach a callback to an ActiveRecord model such as `before_save` that will only execute when the plugin is enabled.