<commit_before>class RaidsController < ApplicationController
  def index
    authorize! :read, Raid
    @raids = @account.available_raids

    @raids.each do |raid|
      authorize! :read, raid
    end

    @all_accounts = @raids.map(&:account).uniq.sort
    @all_signups = @raids.inject([]) do |signups, raid|
      signups + raid.signups
    end
    @all_characters = @all_signups.map(&:character).uniq.sort
    @all_guilds = @all_characters.map(&:guild).uniq.compact.sort
    @all_permissions = @raids.inject([]) do |permissions, raid|
      if can? :manage, raid
        raid.permissions<commit_msg>Load all permissions after loading available raids<commit_after>class RaidsController < ApplicationController
  def index
    authorize! :read, Raid
    @raids = @account.available_raids

    @raids.each do |raid|
      authorize! :read, raid
    end

    @all_accounts = @raids.map(&:account).uniq.sort
    @all_signups = @raids.inject([]) do |signups, raid|
      signups + raid.signups
    end
    @all_characters = @all_signups.map(&:character).uniq.sort
    @all_guilds = @all_characters.map(&:guild).uniq.compact.sort
    @all_permissions = @raids.inject([]) do |permissions, raid|
      if can? :manage, raid
        raid.permissions(true)
{'fraction_non_alphanumeric': 0.12489991993594876, 'fraction_numerical': 0.0, 'mean_word_length': 3.5454545454545454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2473048', 'n_tokens_mistral': 433, 'n_tokens_neox': 423, 'n_words': 87}