Actions
Bug #14458
closedTaxonomy search should search with STI base class
Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
Description
When searching with taxonomy scope, We are looking by model name. This may cause no results if the model is an STI child as the inner_select method adds the model.name (ArfReport) and not the base class name ("Report", which is what is saved in the taxable_taxonomies).
https://github.com/theforeman/foreman/blob/develop/app/models/concerns/taxonomix.rb#L99-L113
A possible solution: condition should change to self.base_class.name
If it is an STI it will call the parent name. If not an STI, it will call itself (current behavior).
Example: https://github.com/theforeman/foreman_openscap/pull/157/files#diff-219a837adc650cf4c4ceae3c8a76eb7dR176
Actions