Improve handling of selected inventories in reports [SCI-5699]

This commit is contained in:
Oleksii Kriuchykhin 2021-05-07 14:55:01 +02:00
parent 7bc6abd9bb
commit 62b919cd8f

View file

@ -114,9 +114,9 @@ class ReportsController < ApplicationController
@report.settings = Report::DEFAULT_SETTINGS if @report.settings.blank? @report.settings = Report::DEFAULT_SETTINGS if @report.settings.blank?
@project_contents = { @project_contents = {
experiments: @report.report_elements.where(type_of: 'experiment').pluck(:experiment_id), experiments: @report.report_elements.experiment.pluck(:experiment_id),
my_modules: @report.report_elements.where(type_of: 'my_module').pluck(:my_module_id), my_modules: @report.report_elements.my_module.pluck(:my_module_id),
repositories: @report.report_elements.where(type_of: 'my_module_repository').pluck(:repository_id).uniq repositories: @report.report_elements.my_module_repository.distinct(:repository_id).pluck(:repository_id)
} }
render :new render :new
end end