Weekly digest of Rails framework changes covering a new HTTP QUERY method for routes, a Rails-flavored startup banner for the console, configurable ffmpeg/ffprobe arguments for Active Storage, schema readers accepting multiple tables at once, several bug fixes (LengthValidator crash, find_by_sql bind parameters, normalizes ordering with enum), and a few breaking changes: deprecation of the create alias for insert, kwargs split off #args in middleware entries, ERB configuration moving to ActionView::Base, MySQL sql_mode now appending TRADITIONAL instead of STRICT_ALL_TABLES, and a shape change to CommandRecorder#commands. 28 contributors participated this week.
Questions this post answers
What does the new HTTP QUERY method support look like in Rails routing?
Rails added routing support for the HTTP QUERY method via a query helper in routes.rb, such as query "search", to: "search#index", plus a via: :query option for match. QUERY is a safe, idempotent method that conveys the query in the request body, useful for filters too large or structured for a URL query string. Requests expose request.query? and request.request_method_symbol as :query, and integration tests can call query "/search", params: {...}, as: :json. Rails developers tracking new routing capabilities like this can follow framework updates on daily.dev.
Why does my Rails enum with normalizes raise an error before the value gets normalized?
In affected Rails versions, normalizes ran after the underlying type's validation, so a raw value like " Pending " hit an enum's assert_valid_value check before normalization stripped whitespace and lowercased it, causing a raise. This has been fixed so normalization now runs first, letting " Pending " become "pending" and pass enum validation as expected. Developers debugging Active Record enum and normalizes interactions can track fixes like this on daily.dev.
Why did appending sql_mode break strict mode on Amazon RDS MySQL databases in Rails?
Rails previously appended only STRICT_ALL_TABLES to MySQL's sql_mode, but on environments where the global sql_mode is empty by default, like Amazon RDS and Aurora MySQL parameter groups, this left out NO_ZERO_IN_DATE, NO_ZERO_DATE, and ERROR_FOR_DIVISION_BY_ZERO, which MySQL 5.7+ otherwise includes by default. Rails now appends TRADITIONAL instead, closing that gap. Teams running Rails on RDS or Aurora MySQL can stay ahead of sql_mode changes via daily.dev.