Audits taxonomies are being set from current context for non-taxable resources
Description of problem:
the taxonomies are being set even for resources that do not use them.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. switch context so you're in org1 and loc1
2. create architecture
3. go to audits page, you should see the audit
4. switch to org2, you should still see the audit because architecture is non-taxable, the audit lives only in org1
#2 Updated by Ondřej Pražák about 1 year ago
Maybe something like https://github.com/xprazak2/foreman/commit/80fddf7f93a7ec9d963fd390a030b9a52250fdde could work.
#3 Updated by Marek Hulán about 1 year ago
Yes, that's the idea. Sebastian is looking into this. We were thinking of adding taxable? method to ApplicationRecord but in fact we need to distinguish also between resources, that supports both taxonomies, only organizations (most of katello models) and none. Is something like supports_organizations? and supports_locations? using the respond_to? should work for detection.