<commit_before># Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  layout :layout_by_resource
  protect_from_forgery
  
  helper :all # include all helpers, all the time
  
  before_filter :authenticate_user!
  
  def after_sign_in_path_for(resource)
    if current_user.admin?
      redirect_to 'users#index'
    else
      redirect_to 'clients#index'
    end
  end
  
  
  def layout_by_resource
    if devise_controller? && resource_name == :client<commit_msg>comment out experimental code in application-controller<commit_after># Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  layout :layout_by_resource
  protect_from_forgery
  
  helper :all # include all helpers, all the time
  
  before_filter :authenticate_user!
  
  #def after_sign_in_path_for(resource)
    #if current_client.admin?
    #  redirect_to 'users#index'
    #else
    #  redirect_to 'clients#index'
    #end
  #end
  
  
  def layout_by_resource
    if devise_controller? && resource_name == :client
{'fraction_non_alphanumeric': 0.05731990704879938, 'fraction_numerical': 0.0, 'mean_word_length': 4.147410358565737, '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': '7545494', 'n_tokens_mistral': 379, 'n_tokens_neox': 368, 'n_words': 118}