DRY similar code for controllers index
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 => []