From 39eb8145c2d78a21e4618e52e1ee44994eac910b Mon Sep 17 00:00:00 2001 From: Urban Rotnik Date: Thu, 11 Jun 2020 16:11:23 +0200 Subject: [PATCH] Rename params method --- app/controllers/repository_rows_controller.rb | 9 +++++---- config/initializers/extends.rb | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/controllers/repository_rows_controller.rb b/app/controllers/repository_rows_controller.rb index f5675756a..72869b489 100644 --- a/app/controllers/repository_rows_controller.rb +++ b/app/controllers/repository_rows_controller.rb @@ -129,7 +129,7 @@ class RepositoryRowsController < ApplicationController def copy_records duplicate_service = RepositoryActions::DuplicateRows.new( - current_user, @repository, copy_records_params + current_user, @repository, selected_rows_in_repo_params ) duplicate_service.call render json: { @@ -173,7 +173,7 @@ class RepositoryRowsController < ApplicationController def archive_records service = RepositoryActions::ArchiveRowsService.call(repository: @repository, - repository_rows: copy_records_params, + repository_rows: selected_rows_in_repo_params, user: current_user, team: current_team) @@ -186,7 +186,7 @@ class RepositoryRowsController < ApplicationController def restore_records service = RepositoryActions::RestoreRowsService.call(repository: @repository, - repository_rows: copy_records_params, + repository_rows: selected_rows_in_repo_params, user: current_user, team: current_team) @@ -250,7 +250,8 @@ class RepositoryRowsController < ApplicationController params.permit(selected_rows: []).to_h[:selected_rows] end - def copy_records_params + # Selected rows in scope of current @repository + def selected_rows_in_repo_params process_ids = params[:selected_rows].map(&:to_i).uniq @repository.repository_rows.where(id: process_ids).pluck(:id) end diff --git a/config/initializers/extends.rb b/config/initializers/extends.rb index dd93f4ade..aca55c50c 100644 --- a/config/initializers/extends.rb +++ b/config/initializers/extends.rb @@ -283,8 +283,8 @@ class Extends set_task_start_date: 138, change_task_start_date: 139, remove_task_start_date: 140, - archive_inventory_item: 141, - restore_inventory_item: 142 + archive_inventory_item: 142, + restore_inventory_item: 143 } ACTIVITY_GROUPS = { @@ -295,7 +295,7 @@ class Extends task_inventory: [55, 56], experiment: [*27..31, 57], reports: [48, 50, 49], - inventories: [70, 71, 105, 72, 73, 74, 102, 75, 76, 77, 78, 96, 107, 113, 114, *133..136, 141, 142], + inventories: [70, 71, 105, 72, 73, 74, 102, 75, 76, 77, 78, 96, 107, 113, 114, *133..136, 142, 143], protocol_repository: [80, 103, 89, 87, 79, 90, 91, 88, 85, 86, 84, 81, 82, 83, 101, 112, 123, 125, 117, 119, 129, 131], team: [92, 94, 93, 97, 104]