Refactor #16689
DRY similar code for controllers index
Description
from https://codeclimate.com/github/theforeman/foreman/pull/3889
There are many controllers with the same code in index action - we should DRY it up.
Associated revisions
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 => [[]]
History
#1
Updated by The Foreman Bot over 5 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3893 added
#2
Updated by Shlomi Zadok over 5 years ago
- Target version set to 1.5.3
#3
Updated by Shlomi Zadok over 5 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset ad94991a861ade2d396b6bed39941644f4ebf382.
#4
Updated by Dominic Cleal over 5 years ago
- Category set to Web Interface
- Legacy Backlogs Release (now unused) set to 189
#5
Updated by The Foreman Bot over 5 years ago
- Pull request https://github.com/theforeman/foreman/pull/3894 added
#6
Updated by The Foreman Bot over 5 years ago
- Pull request https://github.com/theforeman/foreman/pull/3913 added
#7
Updated by Kavita Gaikwad about 5 years ago
- Bugzilla link set to 1391885
Fixes #16689 - DRY index action with search