<commit_before># This class controls the Employee model, views, and related actions
#
# Author: <NAME> 
# Copyright: 

class EmployeesController < ApplicationController
  before_filter :authorize_creation,        :only => [:ldap_create, :search_ldap_view]
  before_filter :load_employee,             :only => [:destroy, :toggle_active, :update]
  before_filter :authorize_update,          :only => [:edit, :update]
  before_filter :load_active_years,         :only => [:edit, :update]
  before_filter :load_all_years,            :only => [:show]
  before_filter :load_associations,         :only => [:edit, :show, :update]
  before_filter :load_available_associations, :only => [:edit, :update]
  before_filter :load_allocation_precision, :only => [:edit, :show, :update]
  before_filter :load_possible_allocations, :only => [:edit, :update]
  skip_before_filter :remind_user_to_set_allocations, :only => [:edit, :update, :update_settings,
                                                                :user_settings]



# View-related methods

  # Page for editing an existing employee
  def edit
  end


  # Starts out as a list of all employees, but can be restricted by a search
  def index
    if !params[:name_to_search_for].blank?
      array_of_strings_to_search_for = params[:name_to_search_for].split(" ")
      conditions = []
      conditions << ("name_last LIKE '%#{array_of_strings_to_search_for[0]}%'")
      conditions << ("name_first LIKE '%#{array_of_strings_to_search_for[0]}%'")
      if array_of_strings_to_search_for.length > 1<commit_msg>Fix permissions issue with employees controller<commit_after># This class controls the Employee model, views, and related actions
#
# Author: <NAME> 
# Copyright: 

class EmployeesController < ApplicationController
  before_filter :authorize_creation,        :only => [:ldap_create, :search_ldap_view]
  before_filter :load_employee,             :only => [:destroy, :toggle_active, :update]
  before_filter :load_active_years,         :only => [:edit, :update]
  before_filter :load_all_years,            :only => [:show]
  before_filter :load_associations,         :only => [:edit, :show, :update]
  before_filter :load_available_associations, :only => [:edit, :update]
  before_filter :load_allocation_precision, :only => [:edit, :show, :update]
  before_filter :load_possible_allocations, :only => [:edit, :update]
  before_filter :authorize_update,          :only => [:edit, :update]
  skip_before_filter :remind_user_to_set_allocations, :only => [:edit, :update, :update_settings,
                                                                :user_settings]



# View-related methods

  # Page for editing an existing employee
  def edit
  end


  # Starts out as a list of all employees, but can be restricted by a search
  def index
    if !params[:name_to_search_for].blank?
      array_of_strings_to_search_for = params[:name_to_search_for].split(" ")
      conditions = []
      conditions << ("name_last LIKE '%#{array_of_strings_to_search_for[0]}%'")
      conditions << ("name_first LIKE '%#{array_of_strings_to_search_for[0]}%'")
      if array_of_strings_to_search_for.length > 1
{'fraction_non_alphanumeric': 0.1120253164556962, 'fraction_numerical': 0.0018987341772151898, 'mean_word_length': 3.6899109792284865, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2874538', 'n_tokens_mistral': 982, 'n_tokens_neox': 951, 'n_words': 234}