The Wire · Showcase
RAILS ADDS SAFER DATE FORMATTING AND PARAMETER TRANSFORMATIONS
By RepoJournal · Filed · About Rails
Rails is shipping new APIs for custom date formats and deep parameter transformations, giving you guardrails where before there were none.
Two major quality-of-life improvements landed in rails/rails overnight. First, `ActiveSupport::TimeFormats` and `ActiveSupport::DateFormats` [1] let you register custom date formats without mutating global constants, keeping your date handling clean and testable. Second, `ActionController::Parameters#deep_transform_values` [2] solves a real pain point: you can now normalize nested params (strip whitespace, cast values) while preserving Rails' strong-parameters safety checks. Until now, developers had to bail out to `params.to_unsafe_h.deep_transform_values`, which nuked the permitted/unpermitted distinction entirely. Over in rails/marcel, the file-type detection library just shipped v1.2.0 [3] with a critical fix: it no longer mutates the source IO stream during magic-byte detection, which means you can safely pass the same IO object around without side effects. The release also improves SVG and HTML detection, adds BOM CSV support, and introduces unicode string handling. These feel like minor wins until your production uploader breaks because something reused an IO object.
Action items
- → Review the new date format APIs for your time-handling code; this replaces the old constant-mutation pattern rails/rails [plan]
- → Audit params transformations where you're currently calling to_unsafe_h; migrate to deep_transform_values to keep strong parameters intact rails/rails [plan]
- → Upgrade marcel to v1.2.0 if you're passing IO objects to file type detection in loops or shared contexts rails/marcel [monitor]
References
- [1] Introduce `ActiveSupport::TimeFormats` and `ActiveSupport::DateFormats` for registering custom date formats ↗ rails/rails
- [2] Add ActionController::Parameters#deep_transform_values ↗ rails/rails
- [3] v1.2.0 ↗ rails/marcel
FAQ
- What changed in Rails on May 21, 2026?
- Rails is shipping new APIs for custom date formats and deep parameter transformations, giving you guardrails where before there were none.
- What should Rails teams do about it?
- Review the new date format APIs for your time-handling code; this replaces the old constant-mutation pattern • Audit params transformations where you're currently calling to_unsafe_h; migrate to deep_transform_values to keep strong parameters intact • Upgrade marcel to v1.2.0 if you're passing IO objects to file type detection in loops or shared contexts
- Which Rails repositories shipped on May 21, 2026?
- rails/rails, rails/marcel