mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-13 16:40:48 +00:00
Still moving logic out of the models
This commit is contained in:
14
app/services/bracket_advancement/advance_wrestler.rb
Normal file
14
app/services/bracket_advancement/advance_wrestler.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class AdvanceWrestler
|
||||
def initialize( wrestler )
|
||||
@wrestler = wrestler
|
||||
@tournament = @wrestler.tournament
|
||||
end
|
||||
|
||||
def advance
|
||||
PoolAdvance.new(@wrestler,@wrestler.lastMatch).advanceWrestler if @tournament.tournament_type == "Pool to bracket"
|
||||
end
|
||||
if Rails.env.production?
|
||||
handle_asynchronously :advance
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user