Skip to content

Commit

Permalink
Performance optimizations for Zone.visible queries for tasks and OPS
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Jan 8, 2019
1 parent de0e942 commit dcbf7d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/miq_task_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def build_jobs_tab
@pp_choices = PPCHOICES2 # Get special pp choices for jobs/tasks lists
@settings[:perpage][:job_task] ||= 50 # Default to 50 per page until changed
@tasks_options = HashWithIndifferentAccess.new if @tasks_options.blank?
@tasks_options[:zones] = Zone.visible.collect { |z| z.name if z.miq_servers.present? }.compact
@tasks_options[:zones] = Zone.visible.includes(:miq_servers).collect { |z| z.name if z.miq_servers.present? }.compact
tasks_set_default_options if @tasks_options[@tabform].blank?

@tabs ||= []
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ops_controller/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def db_list(exp = nil)
]
)
elsif model == VmdbDatabaseConnection
@zones = Zone.visible.sort_by(&:name).collect { |z| [z.name, z.name] }
@zones = Zone.visible.order(&:name).collect { |z| [z.name, z.name] }
# for now we dont need this pulldown, need to get a method that gives us a list of workers for filter pulldown
# @workers = MiqWorker.all.sort_by(&:type).collect { |w| [w.friendly_name, w.id] }
end
Expand Down

0 comments on commit dcbf7d1

Please sign in to comment.