Overview
Midas centralizes all monetary behavior in Rails applications using a polymorphic Coin ledger.
Instead of duplicating price_cents and currency columns across dozens of models, Midas stores every monetary value in a single, consistent system.
This prevents rounding bugs, supports multi-currency conversion, and ensures financial logic remains predictable as your application grows.
Why Midas Exists
As systems scale, currency logic becomes one of the most fragile parts of an application.
Teams often duplicate conversion, rounding, and formatting logic in dozens of places.
Midas eliminates this entirely.
Key Features
- Single polymorphic
Coin model for all monetary values
- Multi-currency support using the
money gem
- Declarative
has_coin and has_coins DSL
- Automatic conversion for integers, floats, and
Money objects
- Headless Stimulus-powered currency input field
- Zero schema duplication
- 90%+ test coverage
- Full API documentation and architecture overview
Documentation
Full documentation is available at:
https://midas.whittakertech.com
Installation
gem "whittaker_tech-midas"
Run migrations:
bin/rails railties:install:migrations FROM=whittaker_tech_midas
bin/rails db:migrate
Links
Roadmap
- Exchange rate fetching
- Versioned coin histories
- ViewComponent integrations
- Billing integration examples (Stripe and LemonSqueezy)
License
MIT License, © WhittakerTech.