mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-10 00:11:22 +08:00
Restore deleted method after rebase [SCI-4596]
This commit is contained in:
parent
9c70fa1990
commit
ea740eb2a4
1 changed files with 18 additions and 0 deletions
|
|
@ -56,6 +56,24 @@ module MyModulesHelper
|
|||
action_name == 'results'
|
||||
end
|
||||
|
||||
def grouped_by_prj_exp(my_modules)
|
||||
ungrouped_tasks = my_modules.joins(experiment: :project)
|
||||
.select('experiments.name as experiment_name,
|
||||
experiments.archived as experiment_archived,
|
||||
projects.name as project_name,
|
||||
projects.archived as project_archived,
|
||||
my_modules.*')
|
||||
ungrouped_tasks.group_by { |i| [i[:project_name], i[:experiment_name]] }.map do |group, tasks|
|
||||
{
|
||||
project_name: group[0],
|
||||
project_archived: tasks[0]&.project_archived,
|
||||
experiment_name: group[1],
|
||||
experiment_archived: tasks[0]&.experiment_archived,
|
||||
tasks: tasks
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def assigned_repository_full_view_table_path(my_module, repository)
|
||||
if repository.is_a?(RepositorySnapshot)
|
||||
return full_view_table_my_module_repository_snapshot_path(my_module, repository)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue