fixes #16798 - move scoped_search definitions to STI subclasses
scoped_search doesn't support class inheritance with STI, so registering definitions on the subclass fixes various issues. This fixes an issue where scoped_search on CommonParameter calls Parameter.all and is returned a list of CommonParameters under Rails 4.2, as it relies on a bug (#18806) for applying the type='CommonParameter' condition when calling Parameter.all.
On Rails 5.0, this bug was fixed and calling Parameter.all within a scope on CommonParameter now returns all types of parameters. Registering all scoped_search definitions on the subclasses ensures that scoped_search calls CommonParameter.all instead.
The taxonomies API changed as it called Taxonomix objects with scopes such as `.locations.search_for`, which no longer existed when the scoped_search definitions were removed from Taxonomy (.locations is a Taxonomy association with a where clause). This now explicitly searches via the appropriate Taxonomy subclass.
Related issues
Refactor #16798: Move scoped_search definitions from parent STI classes to subclasses
fixes #16798 - move scoped_search definitions to STI subclasses
scoped_search doesn't support class inheritance with STI, so registering
definitions on the subclass fixes various issues. This fixes an issue
where scoped_search on CommonParameter calls Parameter.all and is
returned a list of CommonParameters under Rails 4.2, as it relies on a
bug (#18806) for applying the type='CommonParameter' condition when
calling Parameter.all.
On Rails 5.0, this bug was fixed and calling Parameter.all within a
scope on CommonParameter now returns all types of parameters.
Registering all scoped_search definitions on the subclasses ensures that
scoped_search calls CommonParameter.all instead.
The taxonomies API changed as it called Taxonomix objects with scopes
such as `.locations.search_for`, which no longer existed when the
scoped_search definitions were removed from Taxonomy (.locations is a
Taxonomy association with a where clause). This now explicitly searches
via the appropriate Taxonomy subclass.