Skip to content

Commit 9ca1a3b

Browse files
committed
fix(scouting): auto-enqueue OE enrichment job on target
1 parent c09ca91 commit 9ca1a3b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/modules/scouting/models/scouting_target.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class ScoutingTarget < ApplicationRecord
5656

5757
# Callbacks
5858
before_save :normalize_summoner_name
59+
after_create_commit :enqueue_oe_enrichment
60+
after_update_commit :enqueue_oe_enrichment, if: :saved_change_to_professional_name?
5961

6062
# ── Meilisearch ────────────────────────────────────────────────────
6163
def self.meili_searchable_attributes
@@ -203,4 +205,10 @@ def pool_diversity_score
203205
def normalize_summoner_name
204206
self.summoner_name = summoner_name.strip if summoner_name.present?
205207
end
208+
209+
def enqueue_oe_enrichment
210+
return unless professional_name.present?
211+
212+
MetaIntelligence::EnrichScoutingTargetWithOeJob.perform_later(id)
213+
end
206214
end

0 commit comments

Comments
 (0)