mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-04 12:14:37 +08:00
Fix typo in update team assignments service, improve shared inventories migration [SCI-7360]
This commit is contained in:
parent
2ddb6d8685
commit
a9e7e81e51
4 changed files with 7 additions and 5 deletions
|
@ -4,9 +4,9 @@ module UserAssignments
|
|||
class RemoveTeamUserAssignmentsJob < ApplicationJob
|
||||
queue_as :high_priority
|
||||
|
||||
def perform(user, team)
|
||||
def perform(team_user_assignment)
|
||||
ActiveRecord::Base.transaction do
|
||||
RemoveTeamUserAssignmentsService.new(user, team).call
|
||||
RemoveTeamUserAssignmentsService.new(team_user_assignment).call
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,9 +4,9 @@ module UserAssignments
|
|||
class UpdateTeamUserAssignmentsJob < ApplicationJob
|
||||
queue_as :high_priority
|
||||
|
||||
def perform(user, team, user_role)
|
||||
def perform(team_user_assignment)
|
||||
ActiveRecord::Base.transaction do
|
||||
UpdateTeamUserAssignmentsService.new(user, team, user_role).call
|
||||
UpdateTeamUserAssignmentsService.new(team_user_assignment).call
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ module UserAssignments
|
|||
def initialize(team_user_assignment)
|
||||
@user = team_user_assignment.user
|
||||
@team = team_user_assignment.assignable
|
||||
@user_role = user_role
|
||||
@user_role = team_user_assignment.user_role
|
||||
end
|
||||
|
||||
def call
|
||||
|
|
|
@ -12,6 +12,8 @@ class MigrateSharedRepositoriesToUserAssignments < ActiveRecord::Migration[6.1]
|
|||
TeamRepository.where(permission_level: %i(shared_read shared_write))
|
||||
.preload(:team, :repository)
|
||||
.find_each do |team_repository|
|
||||
next if team_repository.repository.blank?
|
||||
|
||||
team_repository.team
|
||||
.user_assignments
|
||||
.preload(:user, :user_role)
|
||||
|
|
Loading…
Add table
Reference in a new issue