Merge pull request #3296 from okriuchykhin/ok_SCI_5699

Improve handling of selected inventories in reports [SCI-5699]
This commit is contained in:
Miha Mencin 2021-05-10 10:48:09 +02:00 committed by GitHub
commit 56a6c0825d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -115,9 +115,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