Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable support for using the shopify-money gem #213

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on May 24, 2022

  1. Add configurable support for using a money adapter

    Unfortunately `shopify-money` and `money` do not play well together. Both gems provide a `Money` class and an entry point into the gem at `lib/money.rb`. This makes it pretty difficult to include double_entry in a codebase that makes use of the `shopify-money` gem.
    
    To work around this I've added a configuration option `money_adapter` that allows double_entry to be configured to internally delegate methods to this adapter instead of using the `money` gem directly. This allows users of double_entry to provide an adapter class that allows integration with arbitrary money backends for better interoperability with their system.
    
    This was done by adding a `DoubleEntry::Money` class that delegates its singleton methods to the adapter.
    jeremycw committed May 24, 2022
    Configuration menu
    Copy the full SHA
    f81f524 View commit details
    Browse the repository at this point in the history