Skip to content

Test Type::Boolean#serialize and #serialize_cast_value - #57549

Merged
byroot merged 1 commit into
rails:mainfrom
hammadxcm:test-boolean-serialize
Jun 4, 2026
Merged

byroot merged 1 commit into
rails:mainfrom
hammadxcm:test-boolean-serialize

Conversation

@hammadxcm

Copy link
Copy Markdown
Contributor

ActiveModel::Type::Boolean#serialize mirrors #cast (false-values serialize to false, blank/nil to nil, anything else to true), and #serialize_cast_value passes the already-cast value through unchanged. Only #cast was tested.

This adds coverage for both serialize methods. No production code changes — test-only.

ActiveModel::Type::Boolean#serialize mirrors #cast (false-values
serialize to false, blank/nil to nil, anything else to true), and
#serialize_cast_value passes the already-cast value through
unchanged. Only #cast was tested.

Add coverage for both serialize methods.
@byroot
byroot merged commit 692f5b9 into rails:main Jun 4, 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