<commit_before>class EmployeeObserver < ActiveRecord::Observer

  def after_create(employee)
    WorkQueue.enqueue(Tenant::EmployeeMailer, employee.id)
  end

  def after_update(employee)
    WorkQueue.enqueue(Tenant::EmployeeMailer, employee.id) if employee.changed.any? {|field| field == 'active' } && employee.active
  end
<commit_msg>fixes issue #191 ~ Later updating "Receive e-mail notifications" to send welcome mail to employee<commit_after>class EmployeeObserver < ActiveRecord::Observer

  def after_create(employee)
    WorkQueue.enqueue(Tenant::EmployeeMailer, employee.id)
  end

  def after_update(employee)
    WorkQueue.enqueue(Tenant::EmployeeMailer, employee.id) if employee.changed.any? {|field| field == 'active' || field == 'notify' } && (employee.active || employee.notify)
  end

{'fraction_non_alphanumeric': 0.11471321695760599, 'fraction_numerical': 0.003740648379052369, 'mean_word_length': 5.7478991596638656, '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': '4634992', 'n_tokens_mistral': 252, 'n_tokens_neox': 232, 'n_words': 54}