<commit_before>class Logs < Application
  before :ensure_authenticated
  before :find_game
  before :ensure_author, :only => [:show_live_channel, :show_level_log, :show_game_log]
  before :find_team, :only => [:show_level_log, :show_game_log]
  before :find_level, :only => [:show_level_log, :show_game_log]

  def index
    render
  end

  def show_live_channel
    @logs = Log.all :conditions => { :game_id => @game.id }
    render
  end

  def show_level_log
    @logs = Log.all :conditions => { :game_id => @game.id, :team => @team.name, :level => @level.name }
    render
  end

  def show_game_log
    @logs = Log.all :conditions => { :game_id => @game.id, :team => @team.name}
    render
  end

  def show_full_log
    @logs = Log.all :conditions => { :game_id => @game.id}
    @levels = Level.all :conditions => { :game_id => @game.id }
    @teams = Team.find_by_sql("select * from teams t inner join game_passings gp on t.id = gp.team_id where gp.game_id = #{@game.id}")
    render
  end

  def find_game
    @game = Game.find(params[:game_id])
  end  
  
  def find_team
    @team = Team.find(params[:team_id])
  end

  def find_level
    @level = @team.current_level_in(@game)<commit_msg>Achtung\! Non-action methods should be protected or they will be recognized as actions otherwise<commit_after>class Logs < Application
  before :ensure_authenticated
  before :find_game
  before :ensure_author, :only => [:show_live_channel, :show_level_log, :show_game_log]
  before :find_team, :only => [:show_level_log, :show_game_log]
  before :find_level, :only => [:show_level_log, :show_game_log]

  def index
    render
  end

  def show_live_channel
    @logs = Log.all :conditions => { :game_id => @game.id }
    render
  end

  def show_level_log
    @logs = Log.all :conditions => { :game_id => @game.id, :team => @team.name, :level => @level.name }
    render
  end

  def show_game_log
    @logs = Log.all :conditions => { :game_id => @game.id, :team => @team.name}
    render
  end

  def show_full_log
    @logs = Log.all :conditions => { :game_id => @game.id}
    @levels = Level.all :conditions => { :game_id => @game.id }
    @teams = Team.find_by_sql("select * from teams t inner join game_passings gp on t.id = gp.team_id where gp.game_id = #{@game.id}")
    render
  end

protected

  def find_game
    @game = Game.find(params[:game_id])
  end  
  
  def find_team
    @team = Team.find(params[:team_id])
  end

  def find_level
    @level = @team.current_level_in(@game)
{'fraction_non_alphanumeric': 0.1312199036918138, 'fraction_numerical': 0.0, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6576375', 'n_tokens_mistral': 916, 'n_tokens_neox': 892, 'n_words': 219}