mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 22:15:14 +00:00
Add dryrun option for user data transfer job (#516)
This commit is contained in:
parent
55797f4c55
commit
ff314efff9
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue