<commit_before>class TransactionLogEntry < ActiveRecord::Base
  belongs_to :product, touch: true

  scope :credit,       -> { where(action: 'credit') }
  scope :in_user_wallets, -> { joins('inner join users on users.id = wallet_id') }
  scope :minted,       -> { where(action: 'minted') }
  scope :from_month_start, ->(time) { where('transaction_log_entries.created_at >= ?', TransactionLogEntry.start_of_month(time.to_time)) }
  scope :to_month_end, ->(time) { where('transaction_log_entries.created_at <= ?', TransactionLogEntry.end_of_month(time.to_time)) }
  scope :validated,    -> { where(action: 'validated') }
  scope :with_cents,   -> { where.not(cents: nil) }

  scope :unsynced, -> { where(queue_id: nil) }
  scope :unsynced_by_id, -> (wallet_id){ where(wallet_id: wallet_id) }

  # after_commit :schedule_minter

  def self.balance(product, wallet_id)
    where(product_id: product.id, wallet_id: wallet_id).with_cents.sum(:cents)
  end

  def self.sum_balances(user)
    where(wallet_id: user.id).with_cents.sum(:cents)
  end<commit_msg>removed unnecessary scoping<commit_after>class TransactionLogEntry < ActiveRecord::Base
  belongs_to :product, touch: true

  scope :credit,       -> { where(action: 'credit') }
  scope :in_user_wallets, -> { joins('inner join users on users.id = wallet_id') }
  scope :minted,       -> { where(action: 'minted') }
  scope :from_month_start, ->(time) { where('transaction_log_entries.created_at >= ?', TransactionLogEntry.start_of_month(time.to_time)) }
  scope :to_month_end, ->(time) { where('transaction_log_entries.created_at <= ?', TransactionLogEntry.end_of_month(time.to_time)) }
  scope :validated,    -> { where(action: 'validated') }
  scope :with_cents,   -> { where.not(cents: nil) }

  # after_commit :schedule_minter

  def self.balance(product, wallet_id)
    where(product_id: product.id, wallet_id: wallet_id).with_cents.sum(:cents)
  end

  def self.sum_balances(user)
    where(wallet_id: user.id).with_cents.sum(:cents)
  end
{'fraction_non_alphanumeric': 0.14536340852130325, 'fraction_numerical': 0.0, 'mean_word_length': 4.83625730994152, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, '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': '802244', 'n_tokens_mistral': 705, 'n_tokens_neox': 684, 'n_words': 122}