The Wire · Showcase
Rails drops Python 2 relics, tightens TimeZone validation
By RepoJournal · Filed · About Rails
Rails is removing ruby2_keywords shims across the codebase now that Ruby 3.3.1 is the minimum, while TimeZone#parse gets stricter about invalid input.
The biggest structural change landed with removal of ruby2_keywords usage throughout the framework [1]. These compatibility shims were critical when Rails had to support both Ruby 2.7 and 3.0 during the keyword arguments transition, but with Ruby 3.3.1 now required, they're dead weight. The refactor replaces them with explicit argument forwarding using `*args`, `**kwargs`, `&block`, or the `...` operator where possible. This simplifies code paths and eliminates a whole class of kwargs-related edge cases. On the validation front, TimeZone#parse now raises ArgumentError consistently for any invalid string, unifying behavior that previously returned nil for some bad inputs and raised for others [2]. The inconsistency made it easy to miss data quality problems in production. Documentation also got polished with corrected API links [3] and outdated docstrings about migration command inversion removed [4]. Across both repos, 14 commits and 8 PRs landed in the last 24 hours.
One email a day. Unsubscribe in one click.
Keep up with Rails in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review TimeZone#parse calls in your codebase for silent nil returns that will now raise rails/rails [plan]
- → Remove any custom ruby2_keywords workarounds in your gems if Rails 8+ is your minimum rails/rails [monitor]
References
- [1] Remove `ruby2_keywords` usage ↗ rails/rails
- [2] Add config to raise on invalid TimeZone#parse strings ↗ rails/rails
- [3] [ci-skip][doc] Update link styles in generator guide ↗ rails/rails
- [4] Fix inaccurate docstring in `CommandRecorder#inverse_of` [ci-skip] rails/rails