Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
12345678910111213141516171819202122232425class Games::CategoriesController < ApplicationController before_action :set_game before_action :set_category
def show end
private
def set_game @game = Game.joins(:srdc).find_by(speedrun_dot_com_games: {shortname: params[:game]}) || Game.find_by(id: params[:game])
not_found if @game.nil? end
def set_category @category = @game.categories.where(shortname: params[:category]).or( @game.categories.where(id: params[:category]) ).first
not_found if @category.nil? redirect_to game_category_path(@game, @category) if @game.srdc.try(:shortname).present? && params[:game] == @game.id.to_s endend