mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Add dryrun option for user data transfer job (#516)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class OneTime::TransferUserDataJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(source_user_id, target_user_id)
|
||||
def perform(source_user_id, target_user_id, dry_run: true)
|
||||
@source_user_id = source_user_id
|
||||
@target_user_id = target_user_id
|
||||
|
||||
@@ -18,6 +18,8 @@ class OneTime::TransferUserDataJob < ApplicationJob
|
||||
source_user.save!
|
||||
|
||||
target_user.save!
|
||||
|
||||
raise ActiveRecord::Rollback if dry_run
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user