mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-05-12 00:20:58 +00:00
Added job_owner and 'description' to delayed_job to show on the tournament show page
This commit is contained in:
@@ -7,6 +7,14 @@ class WrestlingdevImporter
|
||||
end
|
||||
|
||||
def import
|
||||
if Rails.env.production?
|
||||
self.delay(:job_owner_id => @tournament.id, :job_owner_type => "Importing a backup").import_raw
|
||||
else
|
||||
import_raw
|
||||
end
|
||||
end
|
||||
|
||||
def import_raw
|
||||
@tournament.curently_generating_matches = 1
|
||||
@tournament.save
|
||||
destroy_all
|
||||
@@ -14,9 +22,6 @@ class WrestlingdevImporter
|
||||
@tournament.curently_generating_matches = nil
|
||||
@tournament.save
|
||||
end
|
||||
if Rails.env.production?
|
||||
handle_asynchronously :import
|
||||
end
|
||||
|
||||
def destroy_all
|
||||
@tournament.mats.reload.each do | mat |
|
||||
|
||||
Reference in New Issue
Block a user