Skip to content

Commit 98579da

Browse files
committed
fix: solve matches scope mismatch
1 parent 4b3fa4a commit 98579da

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

app/jobs/audit_log_job.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class AuditLogJob < ApplicationJob
2626
# @param new_values [Hash] attribute values after the update
2727
# @param user_id [String, nil] UUID of the user who triggered the change (optional)
2828
def perform(organization_id:, entity_type:, entity_id:, old_values:, new_values:, user_id: nil)
29+
Current.organization_id = organization_id
2930
AuditLog.create!(
3031
organization_id: organization_id,
3132
action: 'update',
@@ -35,5 +36,7 @@ def perform(organization_id:, entity_type:, entity_id:, old_values:, new_values:
3536
new_values: new_values,
3637
user_id: user_id
3738
)
39+
ensure
40+
Current.organization_id = nil
3841
end
3942
end

app/modules/matches/services/import_matches_service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ def process_match(match_id, tally)
3535
if Match.exists?(riot_match_id: match_id)
3636
handle_existing_match(match_id, tally)
3737
else
38-
SyncMatchJob.perform_later(match_id, @organization.id, region)
38+
Matches::SyncMatchJob.perform_later(match_id, @organization.id, region)
3939
tally[:imported] += 1
4040
end
4141
end
4242

4343
def handle_existing_match(match_id, tally)
4444
if @force_update
45-
SyncMatchJob.perform_later(match_id, @organization.id, region, force_update: true)
45+
Matches::SyncMatchJob.perform_later(match_id, @organization.id, region, force_update: true)
4646
tally[:updated] += 1
4747
else
4848
tally[:already_imported] += 1

0 commit comments

Comments
 (0)