Skip to content

Test BigInteger serializing string values - #57545

Merged
rafaelfranca merged 1 commit into
rails:mainfrom
hammadxcm:test-big-integer-serialize-string
Jun 2, 2026
Merged

rafaelfranca merged 1 commit into
rails:mainfrom
hammadxcm:test-big-integer-serialize-string

Conversation

@hammadxcm

Copy link
Copy Markdown
Contributor

ActiveModel::Type::BigInteger#serialize accepts strings: a numeric string serializes to its integer, a leading-numeric string is truncated to its integer prefix ("123abc" => 123), and a non-numeric string serializes to nil. Only Integer and integer-like inputs were tested.

This adds coverage for the string serialization branches. No production code changes — test-only.

ActiveModel::Type::BigInteger#serialize accepts strings: a numeric
string serializes to its integer, a leading-numeric string is
truncated to its integer prefix, and a non-numeric string serializes
to nil. Only Integer and integer-like inputs were tested.

Add coverage for the string serialization branches.
@rafaelfranca
rafaelfranca merged commit 7d71398 into rails:main Jun 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants