Skip to content

Fix Map OID deserialize crash for already-parsed Date/DateTime values#239

Open
Uladzimiro wants to merge 1 commit intoPNixx:masterfrom
Uladzimiro:fix-map-already-deserialized
Open

Fix Map OID deserialize crash for already-parsed Date/DateTime values#239
Uladzimiro wants to merge 1 commit intoPNixx:masterfrom
Uladzimiro:fix-map-already-deserialized

Conversation

@Uladzimiro
Copy link
Copy Markdown

When deserialize was called with an already-parsed DateTime or Time value (e.g. via model.instantiate), it would crash with:

TypeError: no implicit conversion of DateTime into String

because DateTime.parse was called on an object instead of a string.

When deserialize was called with an already-parsed DateTime or Time value
(e.g. via model.instantiate), it would crash with:

  TypeError: no implicit conversion of DateTime into String

because DateTime.parse was called on an object instead of a string.

Root cause: already_deserialized? used bare DateTime/Date which resolved
to OID::DateTime/OID::Date (sibling classes in the same module) instead
of the standard library types, so the guard never triggered.

Fix by using ::DateTime, ::Date, ::Time with explicit root namespace.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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