Sequel 5.101.0 Released #2349
jeremyevans
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sequel 5.101.0 has been released!
New Features
A detect_unnecessary_association_options plugin has been added,
which warns or raises for unnecessary association options. For
example, if you have an association such as:
The plugin can inform you that the :class and :key options are
unnecessary, since they are the same as Sequel's defaults for
the options. That allows you to remove the unnecessary options:
The following unnecessary options are detected:
:right_primary_key (single join table associations)
associations)
To use the plugin, generally you would load it into the base model
class before loading subclasses:
After loading subclasses, you would call the
detect_unnecessary_association_options method on the subclasses.
If you are using the subclasses plugin, this can be done via:
Detection also happens implicitly when finalizing associations,
so the following will also work with the subclasses plugin:
By default, the plugin warns for unnecessary association options.
To have it raise an error instead:
Thanks,
Jeremy
Beta Was this translation helpful? Give feedback.
All reactions