<commit_before>#
# The status
# - has a name and a description
class TaskStatus < ActiveRecord::Base
  # Model associations
  has_many :tasks

  scope :not_started,     -> { TaskStatus.find(1) }
  scope :complete,          -> { TaskStatus.find(2) }
  scope :need_help,         -> { TaskStatus.find(3) }
  scope :working_on_it,     -> { TaskStatus.find(4) }
  scope :fix_and_resubmit,  -> { TaskStatus.find(5) }
  scope :do_not_resubmit,   -> { TaskStatus.find(6) }
  scope :redo,              -> { TaskStatus.find(7) }
  scope :discuss,           -> { TaskStatus.find(8) }
  scope :ready_to_mark,     -> { TaskStatus.find(9) }
  scope :demonstrate,       -> { TaskStatus.find(10) }
  scope :fail,              -> { TaskStatus.find(11) }

  def self.status_for_name(name)
    case name.downcase.strip
      when "complete"         then TaskStatus.complete
      when "fix_and_resubmit" then TaskStatus.fix_and_resubmit
      when "fix and resubmit" then TaskStatus.fix_and_resubmit
      when "do_not_resubmit"  then TaskStatus.do_not_resubmit
      when "do not resubmit"  then TaskStatus.do_not_resubmit
      when "redo"             then TaskStatus.redo
      when "need_help"        then TaskStatus.need_help
      when "need help"        then TaskStatus.need_help
      when "working_on_it"    then TaskStatus.working_on_it
      when "working on it"    then TaskStatus.working_on_it
      when "discuss"          then TaskStatus.discuss
      when "ready to mark"    then TaskStatus.ready_to_mark
      when "ready_to_mark"    then TaskStatus.ready_to_mark
      when "fail"             then TaskStatus.fail
      when "f"                then TaskStatus.fail
      else                    TaskStatus.not_started
    end
  end

  def self.staff_assigned_statuses
    TaskStatus.where("id > 4")
  end

  def self.status_key_for_name(name)
    case name
      when "Complete"         then :complete
      when "Not Started"      then :not_started
      when "Fix and Resubmit" then :fix_and_resubmit
      when "Do Not Resubmit"  then :do_not_resubmit
      when "Redo"             then :redo
      when "Need Help"        then :need_help
      when "Working On It"    then :working_on_it
      when "Discuss"          then :discuss
      when "Ready to Mark"    then :ready_to_mark
      when "Demonstrate"      then :demonstrate
      when "Fail"             then :fail
      else :not_started
    end
  end

  def status_key
    TaskStatus.status_key_for_name(name)
  end

end
<commit_msg>FIX: Ensure task status is not case sensitive<commit_after>#
# The status
# - has a name and a description
class TaskStatus < ActiveRecord::Base
  # Model associations
  has_many :tasks

  scope :not_started,     -> { TaskStatus.find(1) }
  scope :complete,          -> { TaskStatus.find(2) }
  scope :need_help,         -> { TaskStatus.find(3) }
  scope :working_on_it,     -> { TaskStatus.find(4) }
  scope :fix_and_resubmit,  -> { TaskStatus.find(5) }
  scope :do_not_resubmit,   -> { TaskStatus.find(6) }
  scope :redo,              -> { TaskStatus.find(7) }
  scope :discuss,           -> { TaskStatus.find(8) }
  scope :ready_to_mark,     -> { TaskStatus.find(9) }
  scope :demonstrate,       -> { TaskStatus.find(10) }
  scope :fail,              -> { TaskStatus.find(11) }

  def self.status_for_name(name)
    case name.downcase.strip
      when "complete"         then TaskStatus.complete
      when "fix_and_resubmit" then TaskStatus.fix_and_resubmit
      when "fix and resubmit" then TaskStatus.fix_and_resubmit
      when "do_not_resubmit"  then TaskStatus.do_not_resubmit
      when "do not resubmit"  then TaskStatus.do_not_resubmit
      when "redo"             then TaskStatus.redo
      when "need_help"        then TaskStatus.need_help
      when "need help"        then TaskStatus.need_help
      when "working_on_it"    then TaskStatus.working_on_it
      when "working on it"    then TaskStatus.working_on_it
      when "discuss"          then TaskStatus.discuss
      when "ready to mark"    then TaskStatus.ready_to_mark
      when "ready_to_mark"    then TaskStatus.ready_to_mark
      when "fail"             then TaskStatus.fail
      when "f"                then TaskStatus.fail
      else                    TaskStatus.not_started
    end
  end

  def self.staff_assigned_statuses
    TaskStatus.where("id > 4")
  end

  def self.status_key_for_name(name)
    case name.downcase
      when "complete"         then :complete
      when "not started"      then :not_started
      when "fix and resubmit" then :fix_and_resubmit
      when "do not resubmit"  then :do_not_resubmit
      when "redo"             then :redo
      when "need help"        then :need_help
      when "working on it"    then :working_on_it
      when "discuss"          then :discuss
      when "ready to mark"    then :ready_to_mark
      when "demonstrate"      then :demonstrate
      when "fail"             then :fail
      else :not_started
    end
  end

  def status_key
    TaskStatus.status_key_for_name(name)
  end

end

{'fraction_non_alphanumeric': 0.0835156094651024, 'fraction_numerical': 0.005567707297673493, 'mean_word_length': 2.268356075373619, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2727186', 'n_tokens_mistral': 1644, 'n_tokens_neox': 1595, 'n_words': 403}