You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously I was seeing many instances of the following deprecation
warning when running `spec/features/admin/schools_spec.rb` which was
cluttering up the build output making it hard to see genuine problems:
DEPRECATION WARNING: The option :class_name is deprecated.
Administrate should detect it automatically.
This was because when the automatic associations functionality [1] was
added to administrate in v0.15.0, the `class_name` option on
`Administrate::Field::Associative#associated_class_name` which is the
superclass for `Administrate::Field::BelongsTo`. The latter is used on
the `SchoolDashboard` with the `class_name` option [3].
However, in the v1.0.0.beta3 release of administrate [4], this
deprecation was reversed [4]. So we could avoid the deprecation by
upgrading administrate. However, since it's a major version bump, it's
like to be a chunk of work. So instead I've patched this specific
functionality to avoid the deprecation warning.
The patch includes code which will fail fast once administrate is
updated to v1.0.0.beta3 or later so that the patch can be removed.
[1]: thoughtbot/administrate#1633
[2]: https://github.com/thoughtbot/administrate/blob/f7287410a93d07f222bd5d4fb5055c6937eace08/CHANGELOG.md#0150-february-26-2021
[3]: https://github.com/RaspberryPiFoundation/editor-api/blob/f397e870f2a33cce1f53b9104c52314f5233572c/app/dashboards/school_dashboard.rb#L14
[4]: thoughtbot/administrate#2697
0 commit comments