# 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