Refactor #16689

DRY similar code for controllers index

Added by Shlomi Zadok 12 months ago. Updated 7 months ago.

Status:Closed
Priority:Normal
Assigned To:Shlomi Zadok
Category:Web Interface
Target version:Team Marek Iteration 3
Difficulty: Bugzilla link:1391885
Found in release: Pull request:https://github.com/theforeman/foreman/pull/3913, https://github.com/theforeman/foreman/pull/3894, https://github.com/theforeman/foreman/pull/3893
Story points-
Velocity based estimate-
Release1.14.0Release relationshipAuto

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
Added by Shlomi Zadok 12 months ago

Fixes #16689 - DRY index action with search

Revision ef0146fd
Added by Daniel Lobato Garcia 12 months 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
Added by Dominic Cleal 12 months 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 12 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3893 added

#2 Updated by Shlomi Zadok 12 months ago

  • Target version set to Team Marek Iteration 3

#3 Updated by Shlomi Zadok 12 months ago

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

#4 Updated by Dominic Cleal 12 months ago

  • Category set to Web Interface
  • Release set to 1.14.0

#5 Updated by The Foreman Bot 12 months ago

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

#6 Updated by The Foreman Bot 12 months ago

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

#7 Updated by Kavita Gaikwad 7 months ago

  • Bugzilla link set to 1391885

Also available in: Atom PDF