lib/roda.rb in roda-3.22.0 vs lib/roda.rb in roda-3.23.0
- old
+ new
@@ -338,11 +338,14 @@
response_class.roda_class = subclass
subclass.const_set(:RodaResponse, response_class)
end
# Load a new plugin into the current class. A plugin can be a module
- # which is used directly, or a symbol represented a registered plugin
+ # which is used directly, or a symbol representing a registered plugin
# which will be required and then used. Returns nil.
+ #
+ # Note that you should not load plugins into a Roda class after the
+ # class has been subclassed, as doing so can break the subclasses.
#
# Roda.plugin PluginModule
# Roda.plugin :csrf
def plugin(plugin, *args, &block)
raise RodaError, "Cannot add a plugin to a frozen Roda class" if frozen?