From a421aace7383bb6718d23eed1bde02659a7a93ff Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Thu, 6 Mar 2014 15:57:26 -0500 Subject: login fixed and some views look better --- app/controllers/sessions_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index f857f27..d5c59d4 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -12,11 +12,7 @@ class SessionsController < ApplicationController def create # find the user... - @user = User.find_by(email: params[:session][:email]) - - if @user.nil? - @user = User.find_by_user_name(params[:session][:user_name]) - end + @user = User.find_by_email(params[:session][:username_or_email]) || User.find_by_user_name(params[:session][:username_or_email]) #@session = Session.new(@user) # ... and create a new session -- cgit v1.2.3-2-g168b From f5d36fc67d1994b7cc1ce02e7be2767ffcb47857 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Thu, 6 Mar 2014 17:25:40 -0500 Subject: new generate --- app/controllers/games_controller.rb | 2 +- app/controllers/teams_controller.rb | 2 +- app/controllers/tournaments_controller.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 4ecff17..5780152 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -69,6 +69,6 @@ class GamesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def game_params - params.require(:game).permit(:name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams) + params.require(:game).permit(:name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams) end end diff --git a/app/controllers/teams_controller.rb b/app/controllers/teams_controller.rb index f14c97f..ccd6781 100644 --- a/app/controllers/teams_controller.rb +++ b/app/controllers/teams_controller.rb @@ -69,6 +69,6 @@ class TeamsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def team_params - params[:team] + params.require(:team).permit(:match_id) end end diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 720305f..346e16b 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -69,6 +69,6 @@ class TournamentsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def tournament_params - params.require(:tournament).permit(:game_id) + params.require(:tournament).permit(:game_id, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :status) end end -- cgit v1.2.3-2-g168b