Class: Wallets::Allocation
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Wallets::Allocation
- Defined in:
- lib/wallets/models/allocation.rb
Overview
Allocations link a negative spend transaction to the positive transactions it consumed from. This is what makes FIFO spending and expiration-aware balances possible without mutating historical transactions.
This class supports embedding: subclasses can override config and table names without affecting the base Wallets::* behavior.
Class Method Summary collapse
Class Method Details
.resolved_config ⇒ Object
18 19 20 21 |
# File 'lib/wallets/models/allocation.rb', line 18 def self.resolved_config value = config_provider value.respond_to?(:call) ? value.call : value end |
.table_name ⇒ Object
14 15 16 |
# File 'lib/wallets/models/allocation.rb', line 14 def self.table_name || "#{resolved_config.table_prefix}allocations" end |