Skip to content

WIP - RUBY-3671 - Hash should honor BSON::Registry #352

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented May 7, 2025

Fixes RUBY-3671

There is a BSON::Registry which determines how BSON is deserialized. For example, Mongoid has this code:

if allow_decimal128
  BSON::Registry.register(BSON::Decimal128::BSON_TYPE, BSON::Decimal128)
else
  BSON::Registry.register(BSON::Decimal128::BSON_TYPE, BigDecimal)
end 

However, BSON gem does not honor this registry for Hash, it always deserializes as BSON::Document, even when the registry is set to Hash.

@johnnyshields johnnyshields requested a review from a team as a code owner May 7, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant