Wednesday, July 15, 2026 3:59:20 AM
> command_count.rb
# frozen_string_literal: true

module ESM
  class CommandCount < ApplicationRecord
    # =============================================================================
    # INITIALIZE
    # =============================================================================

    # =============================================================================
    # DATA STRUCTURE
    # =============================================================================

    attribute :command_name, :string
    attribute :execution_count, :integer

    # =============================================================================
    # ASSOCIATIONS
    # =============================================================================

    # =============================================================================
    # VALIDATIONS
    # =============================================================================

    # =============================================================================
    # CALLBACKS
    # =============================================================================

    # =============================================================================
    # SCOPES
    # =============================================================================

    # =============================================================================
    # CLASS METHODS
    # =============================================================================

    def self.increment_execution_counter(command_name)
      Thread.new do
        where(command_name: name).update_counters(execution_count: 1)
      end
    end

    # =============================================================================
    # INSTANCE METHODS
    # =============================================================================
  end
end
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 43aa0d7