<commit_before>class BaseController < InheritedResources::Base
  before_filter :authenticate_user!, :check_browser, :check_invitation, :load_announcements
  # inherit_resources

  def load_announcements
    @current_and_not_dismissed_announcements = Announcement.current_and_not_dismissed_by(current_user)
  end

  def check_browser
    if browser.ie6? # || browser.ie7?
      redirect_to browser_not_supported_url
    end
  end

  def check_invitation
    if user_signed_in? && session[:start_new_group_token]
      group_request = GroupRequest.find_by_token(session[:start_new_group_token])
      if group_request && (not group_request.accepted?)
        group_request.accept!(current_user)
        flash[:success] = "You have been added to #{group_request.group.name}."
        session[:start_new_group_token] = nil
        redirect_to group_url(group_request.group_id)
      end
    end
  end
end
<commit_msg>I do apologise for my last commit message. This commit, like the last, fixes stupid bugs that we really should have not deployed.. however we are now faced with resolving things in a commit message unfriendly, timely manner<commit_after>class BaseController < InheritedResources::Base
  before_filter :authenticate_user!, :check_browser, :check_invitation, :load_announcements
  # inherit_resources

  def load_announcements
    if current_user
      @current_and_not_dismissed_announcements = Announcement.current_and_not_dismissed_by(current_user)
    end
  end

  def check_browser
    if browser.ie6? # || browser.ie7?
      redirect_to browser_not_supported_url
    end
  end

  def check_invitation
    if user_signed_in? && session[:start_new_group_token]
      group_request = GroupRequest.find_by_token(session[:start_new_group_token])
      if group_request && (not group_request.accepted?)
        group_request.accept!(current_user)
        flash[:success] = "You have been added to #{group_request.group.name}."
        session[:start_new_group_token] = nil
        redirect_to group_url(group_request.group_id)
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.0696999031945789, 'fraction_numerical': 0.001936108422071636, 'mean_word_length': 4.3828125, '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': '7228959', 'n_tokens_mistral': 637, 'n_tokens_neox': 620, 'n_words': 140}