From 62b919cd8fdf4f6431f59b9e100b749e3aec6c85 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Fri, 7 May 2021 14:55:01 +0200 Subject: [PATCH] Improve handling of selected inventories in reports [SCI-5699] --- app/controllers/reports_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index a57be7215..3337ca652 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -114,9 +114,9 @@ class ReportsController < ApplicationController @report.settings = Report::DEFAULT_SETTINGS if @report.settings.blank? @project_contents = { - experiments: @report.report_elements.where(type_of: 'experiment').pluck(:experiment_id), - my_modules: @report.report_elements.where(type_of: 'my_module').pluck(:my_module_id), - repositories: @report.report_elements.where(type_of: 'my_module_repository').pluck(:repository_id).uniq + experiments: @report.report_elements.experiment.pluck(:experiment_id), + my_modules: @report.report_elements.my_module.pluck(:my_module_id), + repositories: @report.report_elements.my_module_repository.distinct(:repository_id).pluck(:repository_id) } render :new end