mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-02 21:20:08 +08:00
Merge pull request #4563 from okriuchykhin/ok_SCI_7360_v2
Fix typo in update team assignments service, improve shared inventories migration [SCI-7360]
This commit is contained in:
commit
3bc3036b58
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…
Reference in a new issue