Ruby on Rails v6.0.1 Release Notes
Release Date: 2019-11-05 // over 4 years ago-
π Active Support
π
ActiveSupport::SafeBuffer
supportsEnumerator
methods.Shugo Maeda
The Redis cache store fails gracefully when the server returns a "max number of clients reached" error.
Brandon Medenwald
π Fixed that mutating a value returned by a memory cache store would unexpectedly change the cached value.
Jonathan Hyman
0οΈβ£ The default inflectors in
zeitwerk
mode support overrides:# config/initializers/zeitwerk.rbRails.autoloaders.each do |autoloader| autoloader.inflector.inflect( "html\_parser" =\> "HTMLParser", "ssl\_error" =\> "SSLError" )end
π That way, you can tweak how individual basenames are inflected without touching Active Support inflection rules, which are global. These inflectors fallback to
String#camelize
, so existing inflection rules are still taken into account for non-overridden basenames.Please, check the autoloading guide for
zeitwerk
mode if you prefer not to depend onString#camelize
at all.Xavier Noria
π Improve
Range#===
,Range#include?
, andRange#cover?
to work with beginless (startless) and endless range targets.Allen Hsu, Andrew Hodgkinson
Don't use
Process#clock_gettime(CLOCK_PROCESS_CPUTIME_ID)
on SolarisIain Beeston
Active Model
- No changes.
Active Record
Common Table Expressions are allowed on read-only connections.
Chris Morris
π New record instantiation respects
unscope
.Ryuta Kamizono
Fixed a case where
find_in_batches
could halt too early.Takayuki Nakata
Autosaved associations always perform validations when a custom validation context is used.
Tekin Suleyman
π°
sql.active_record
notifications now include the:connection
in their payloads.Eugene Kenny
βͺ A rollback encountered in an
after_commit
callback does not reset previously-committed record state.Ryuta Kamizono
π Fixed that join order was lost when eager-loading.
Ryuta Kamizono
DESCRIBE
queries are allowed on read-only connections.Dylan Thacker-Smith
π Fixed that records that had been
inspect
ed could not be marshaled.Eugene Kenny
π The connection pool reaper thread is respawned in forked processes. This fixes that idle connections in forked processes wouldn't be reaped.
John Hawthorn
The memoized result of
ActiveRecord::Relation#take
is properly cleared whenActiveRecord::Relation#reset
orActiveRecord::Relation#reload
is called.Anmol Arora
π Fixed the performance regression for
primary_keys
introduced MySQL 8.0.Hiroyuki Ishii
insert
,insert_all
,upsert
, andupsert_all
now clear the query cache.Eugene Kenny
Call
while_preventing_writes
directly fromconnected_to
.In some cases application authors want to use the database switching middleware and make explicit calls with
connected_to
. It's possible for an app to turn off writes and not turn them back on by the time we callconnected_to(role: :writing)
.This change allows apps to fix this by assuming if a role is writing we want to allow writes, except in the case it's explicitly turned off.
Eileen M. Uchitelle
π Improve detection of ActiveRecord::StatementTimeout with mysql2 adapter in the edge case when the query is terminated during filesort.
Kir Shatrov
Action View
UJS avoids
Element.closest()
for IE 9 compatibility.George Claghorn
Action Pack
β
ActionDispatch::SystemTestCase
now inherits fromActiveSupport::TestCase
rather thanActionDispatch::IntegrationTest
. This permits running jobs in system tests.George Claghorn, Edouard Chin
Registered MIME types may contain extra flags:
Mime::Type.register "text/html; fragment", :html\_fragment
Aaron Patterson
π· Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
π·
ActiveStorage::AnalyzeJob
s are discarded onActiveRecord::RecordNotFound
errors.George Claghorn
π Blobs are recorded in the database before being uploaded to the service. This fixes that generated blob keys could silently collide, leading to data loss.
Julik Tarkhanov
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
The
zeitwerk:check
Rake task reports files outside the app's root directory, as in engines loaded from gems.Xavier Noria
π Fixed a possible error when using the evented file update checker.
Yuji Yaginuma
β The sqlite3 database files created by the parallel testing feature are included in the default
.gitignore
file for newly-generated apps.Yasuo Honda
π
rails new
generates a.keep
file intmp/pids
. This fixes starting a server viarackup
instead ofrails server
.Rafael Mendonça França