DRY similar code for controllers index
|Assigned To:||Shlomi Zadok|
|Target version:||Team Marek Iteration 3|
|Found in release:||Pull request:||https://github.com/theforeman/foreman/pull/3893, https://github.com/theforeman/foreman/pull/3894, https://github.com/theforeman/foreman/pull/3913|
|Velocity based estimate||-|
There are many controllers with the same code in index action - we should DRY it up.
Refs #16689 - Missing DRY index action controllers
Some of the controllers that could have used the refactor in #16689 were
not added in that commit.
Additionally, I've fixed the '.includes' leftover in those controllers
from Rails 3 to be '.eager_load' now. '.includes' does not change the
query in any way unless you call '.references' afterwards.
refs #16689 - expand array of eager load tables
Previously an array of tables (e.g. on Puppetclasses, SubnetsController)
triggered false positive warnings from Bullet:
| Unused Eager Loading detected | Subnet::Ipv4 => [[:domains, :dhcp]]
and when no tables were passed on most index pages:
| Unused Eager Loading detected | Domain => []