Module: HrLite::EncryptedMoney
- Extended by:
- ActiveSupport::Concern
- Included in:
- EmployeeProfile, SalarySlip, SalaryStructure
- Defined in:
- app/models/concerns/hr_lite/encrypted_money.rb
Overview
Money that must be encrypted at rest. Rails encrypts only works on
text columns, so amounts are stored as canonical decimal strings and
surfaced as BigDecimal. BigDecimal in, BigDecimal out; Float never.
Accepted trade-off (documented): encrypted amounts cannot be aggregated in SQL — all totals are computed in Ruby. Fine well past 100 employees.