diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 227949015..babcb4ef7 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -428,7 +428,7 @@ class RepositoriesController < ApplicationController def selected_repos_params process_ids = params[:selected_repos].map(&:to_i).uniq - Repository.where(id: process_ids, team_id: current_team).pluck(:id) + Repository.where(id: process_ids, team_id: current_team).with_archived.pluck(:id) end def repository_response(message) diff --git a/app/services/repositories/archive_repository_service.rb b/app/services/repositories/archive_repository_service.rb index 7a981496f..b4d5bb8db 100644 --- a/app/services/repositories/archive_repository_service.rb +++ b/app/services/repositories/archive_repository_service.rb @@ -7,13 +7,13 @@ module Repositories ActiveRecord::Base.transaction do @repositories.each do |repository| + log_activity(:archive_inventory, repository) repository.archive!(@user) RepositoryActions::ArchiveRowsService.call(repository: repository, repository_rows: repository.repository_rows.pluck(:id), user: @user, team: @team) - log_activity(:archive_inventory, repository) end rescue ActiveRecord::RecordNotSaved @errors[:archiving_error] = I18n.t('repositories.archive_inventories.unsuccess_flash') diff --git a/app/services/repositories/restore_repository_service.rb b/app/services/repositories/restore_repository_service.rb index bc8411263..896aef8c0 100644 --- a/app/services/repositories/restore_repository_service.rb +++ b/app/services/repositories/restore_repository_service.rb @@ -26,7 +26,7 @@ module Repositories private def scoped_repositories(ids) - Repository.where(id: ids, team_id: @team).archived + Repository.where(id: ids, team_id: @team).with_archived end end end