Project

General

Profile

Actions

Bug #18841

closed

Avoid N+1 query in foreman hosts index by declaring proper scope

Added by Shimon Shtein over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Add this to plugin declaration:

  add_controller_action_scope(::Api::V2::HostsController, :index) do |base_scope|
    base_scope.includes(:policies)
  end
Actions #1

Updated by Shimon Shtein over 7 years ago

Add similar handling to UI hosts controller too.

Actions #2

Updated by The Foreman Bot over 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Shimon Shtein
  • Pull request https://github.com/theforeman/foreman_openscap/pull/247 added
Actions #3

Updated by Shimon Shtein over 7 years ago

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

Updated by Marek Hulán over 7 years ago

  • Translation missing: en.field_release set to 225
Actions #5

Updated by Ivan Necas over 7 years ago

  • Target version set to 1.12.0
Actions #6

Updated by Ivan Necas over 7 years ago

  • Target version changed from 1.12.0 to 1.12.2
Actions

Also available in: Atom PDF