<commit_before>class Order < ActiveRecord::Base
  has_many   :order_items
  belongs_to :user
  belongs_to :address
  belongs_to :shipping_method
  enum status: [:new_order, :picking, :packing, :shipped, :ready_for_pickup]

  def total_cost
    order_items.inject(0) { |sum, i| sum + (i.price * i.quantity) }
  end

  def items
    order_items.length
  end

  def units
    order_items.inject(0) { |sum, i| sum + i.quantity }
  end
end<commit_msg>Add status_name method to order model<commit_after>class Order < ActiveRecord::Base
  has_many   :order_items
  belongs_to :user
  belongs_to :address
  belongs_to :shipping_method
  enum status: [:new_order, :picking, :packing, :shipped, :ready_for_pickup]

  def total_cost
    order_items.inject(0) { |sum, i| sum + (i.price * i.quantity) }
  end

  def items
    order_items.length
  end

  def units
    order_items.inject(0) { |sum, i| sum + i.quantity }
  end

  def status_name
    names = {
      new_order: 'New Order',
      ready_for_pickup: 'Ready for Pickup',
    }
    names[status.to_sym] || status.capitalize
  end
end
{'fraction_non_alphanumeric': 0.1026827012025902, 'fraction_numerical': 0.0037002775208140612, 'mean_word_length': 3.546218487394958, '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': '3666101', 'n_tokens_mistral': 401, 'n_tokens_neox': 394, 'n_words': 97}