1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Trying to fix async jobs

This commit is contained in:
2015-12-29 22:53:53 +00:00
parent aa2fc9c804
commit a911183637
3 changed files with 11 additions and 7 deletions

View File

@@ -4,10 +4,7 @@ class Match < ActiveRecord::Base
belongs_to :mat, touch: true
has_many :wrestlers, :through => :weight
if Rails.env.production?
handle_asynchronously :advance_wrestlers
handle_asynchronously :calcSchoolPoints
end
after_update do
if self.finished == 1 && self.winner_id != nil
@@ -28,6 +25,9 @@ class Match < ActiveRecord::Base
wrestler2.school.calcScore
end
end
if Rails.env.production?
handle_asynchronously :calcSchoolPoints
end
def mat_assigned
if self.mat
@@ -57,6 +57,9 @@ class Match < ActiveRecord::Base
self.mat.assignNextMatch
end
end
if Rails.env.production?
handle_asynchronously :advance_wrestlers
end
def bracketScore
if self.finished != 1