mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-17 21:29:13 +00:00
Refactored generating matches
This commit is contained in:
@@ -87,10 +87,9 @@ class StaticPagesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def generate_matches
|
def generate_matches
|
||||||
if user_signed_in?
|
if !user_signed_in?
|
||||||
else
|
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
elsif user_signed_in?
|
||||||
if params[:tournament]
|
if params[:tournament]
|
||||||
@tournament = Tournament.find(params[:tournament])
|
@tournament = Tournament.find(params[:tournament])
|
||||||
end
|
end
|
||||||
@@ -99,3 +98,4 @@ class StaticPagesController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ class Tournament < ActiveRecord::Base
|
|||||||
if matches.nil?
|
if matches.nil?
|
||||||
return nil
|
return nil
|
||||||
else
|
else
|
||||||
generateMatchups
|
|
||||||
matches
|
matches
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user