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

Stringify money BigDecimal value in Active Job serializer #253

Merged
merged 1 commit into from Jan 20, 2023
Merged

Stringify money BigDecimal value in Active Job serializer #253

merged 1 commit into from Jan 20, 2023

Commits on Jan 13, 2023

  1. Stringify money BigDecimal value in Active Job serializer

    Sidekiq 7.0 by default enforces that values must be JSON safe: https://github.com/mperham/sidekiq/blob/v7.0.0/lib/sidekiq/job_util.rb#L68
    i.e. before and after a serialization roundtrip be exactly the same.
    
    Before this fix ActiveJob enqueues a BigDecimal, which eventually does end up in the same string representation thanks to Active Support's extension: https://guides.rubyonrails.org/v7.0.0/active_support_core_extensions.html#extensions-to-bigdecimal
    with thix fix we do the same explicitly to make Sidekiq happy.
    
    Since Money can handle well-formed string values there are no forwards or backwards compatibility problems.
    bdewater-thatch committed Jan 13, 2023
    Configuration menu
    Copy the full SHA
    240ef13 View commit details
    Browse the repository at this point in the history