<commit_before># == Schema Information
#
# Table name: categories
#
#  id         :integer          not null, primary key
#  account_id :integer          not null
#  name       :string(255)      not null
#  created_by :integer
#  updated_by :integer
#  created_at :datetime
#  updated_at :datetime
#

class Category < ActiveRecord::Base
  belongs_to  :account
  has_many    :transactions, dependent: :restrict_with_error

  validates_presence_of   :name, :account_id
  validates_uniqueness_of :name, scope: :account_id
end<commit_msg>adding scope for ordering by name<commit_after># == Schema Information
#
# Table name: categories
#
#  id         :integer          not null, primary key
#  account_id :integer          not null
#  name       :string(255)      not null
#  created_by :integer
#  updated_by :integer
#  created_at :datetime
#  updated_at :datetime
#

class Category < ActiveRecord::Base
  belongs_to  :account
  has_many    :transactions, dependent: :restrict_with_error

  scope :order_by_name, -> { order(name: :asc) }

  validates_presence_of   :name, :account_id
  validates_uniqueness_of :name, scope: :account_id
end
{'fraction_non_alphanumeric': 0.0843585237258348, 'fraction_numerical': 0.005272407732864675, 'mean_word_length': 3.537848605577689, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '7423262', 'n_tokens_mistral': 367, 'n_tokens_neox': 361, 'n_words': 98}