Module: Plutonium::Models::HasCents
- Extended by:
- ActiveSupport::Concern
- Included in:
- Resource::Record
- Defined in:
- lib/plutonium/models/has_cents.rb
Overview
Note:
This module automatically handles validation propagation. If a validation error is applied to the cents attribute, the decimal attribute will be marked as invalid.
Note:
The module uses BigDecimal for internal calculations to ensure precision in monetary operations.
HasCents module provides functionality to handle monetary values stored as cents and expose them as decimal values. It also ensures that validations applied to the cents attribute are inherited by the decimal attribute.
Defined Under Namespace
Modules: ClassMethods