Project

General

Profile

Actions

Bug #14458

closed

Taxonomy search should search with STI base class

Added by Shlomi Zadok over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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


Related issues 1 (0 open1 closed)

Related to OpenSCAP - Bug #14446: compliance reports from a particular org should be visible when org context is setResolvedShlomi Zadok04/04/2016Actions
Actions

Also available in: Atom PDF