mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-29 03:01:58 +08:00
Fix default scope bugs
This commit is contained in:
parent
6e8062179c
commit
3d59bbd50e
3 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue