Project

General

Profile

Refactor #16689

DRY similar code for controllers index

Added by Shlomi Zadok almost 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:

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

Revision ad94991a (diff)
Added by Shlomi Zadok almost 3 years ago

Fixes #16689 - DRY index action with search

Revision ef0146fd (diff)
Added by Daniel Lobato Garcia almost 3 years ago

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.

Revision e197f74f (diff)
Added by Dominic Cleal almost 3 years ago

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 almost 3 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 almost 3 years ago

  • Target version set to 1.5.3

#3 Updated by Shlomi Zadok almost 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal almost 3 years ago

  • Category set to Web Interface
  • Legacy Backlogs Release (now unused) set to 189

#5 Updated by The Foreman Bot almost 3 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3894 added

#6 Updated by The Foreman Bot almost 3 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3913 added

#7 Updated by Kavita Gaikwad over 2 years ago

  • Bugzilla link set to 1391885

Also available in: Atom PDF