<commit_before>require 'application_responder'

class ApplicationController < ActionController::Base
  before_filter :set_user_time_zone


  self.responder = ApplicationResponder
  respond_to :html, :json
  WillPaginate.per_page = 10

  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
  protected
  def set_user_time_zone
    Time.zone = current_user.time_zone if user_signed_in? && current_user.time_zone.present?
  end



  layout :layouter

  def layouter
    l = 'application'
    l = 'users' if user_signed_in?
    l = 'teachers' if teacher_signed_in?
    l
  end

  def after_sign_in_path_for(resource)
    case resource
      when User then users_welcome_path

      when Admin then hq_dashboard_index_path

      when Teacher then teachers_welcome_path
          end
    end

  end<commit_msg>#6 #7 #8 little refactoring<commit_after>require 'application_responder'

class ApplicationController < ActionController::Base
  before_filter :set_user_time_zone


  self.responder = ApplicationResponder
  respond_to :html, :json
  WillPaginate.per_page = 10

  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
  protected
  def set_user_time_zone
    Time.zone = current_user.time_zone if user_signed_in? && current_user.time_zone.present?
  end

  layout :layouter

  def layouter
    l = 'application'
    l = 'users' if user_signed_in?
    l = 'teachers' if teacher_signed_in?
    l
  end

  def after_sign_in_path_for(resource)
    case resource
      when User then users_welcome_path
      when Admin then hq_dashboard_index_path
      when Teacher then teachers_welcome_path
          end
    end
  end
{'fraction_non_alphanumeric': 0.05373961218836565, 'fraction_numerical': 0.003878116343490305, 'mean_word_length': 3.703125, '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': '4320022', 'n_tokens_mistral': 587, 'n_tokens_neox': 561, 'n_words': 157}