Update dependency rails to v7.2.3 #1477
Open
+61
−56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
7.2.2.2->7.2.3Release Notes
rails/rails (rails)
v7.2.3: 7.2.3Compare Source
Active Support
Fix
Enumerable#soleto return the full tuple instead of just the first element of the tuple.Olivier Bellone
Fix parallel tests hanging when worker processes die abruptly.
Previously, if a worker process was killed (e.g., OOM killed,
kill -9) during paralleltest execution, the test suite would hang forever waiting for the dead worker.
Joshua Young
ActiveSupport::FileUpdateCheckerdoes not depend onTime.nowto prevent unnecessary reloads with time travel test helpersJan Grodowski
Fix
ActiveSupport::BroadcastLoggerfrom executing a block argument for each logger (tagged, info, etc.).Jared Armstrong
Fix
ActiveSupport::HashWithIndifferentAccess#transform_keys!removing defaults.Hartley McGuire
Fix
ActiveSupport::HashWithIndifferentAccess#tranform_keys!to handle collisions.If the transformation would result in a key equal to another not yet transformed one,
it would result in keys being lost.
Before:
After:
Jason T Johnson, Jean Boussier
Fix
ActiveSupport::Cache::MemCacheStore#read_multito handle network errors.This method specifically wasn't handling network errors like other codepaths.
Alessandro Dal Grande
Fix Active Support Cache
fetch_multiwhen local store is active.fetch_multinow properly yield to the provided block for missing entriesthat have been recorded as such in the local store.
Jean Boussier
Fix execution wrapping to report all exceptions, including
Exception.If a more serious error like
SystemStackErrororNoMemoryErrorhappens,the error reporter should be able to report these kinds of exceptions.
Gannon McGibbon
Fix
RedisCacheStoreandMemCacheStoreto also handle connection pool related errors.These errors are rescued and reported to
Rails.error.Jean Boussier
Fix
ActiveSupport::Cache#read_multito respect version expiry when using local cache.zzak
Fix
ActiveSupport::MessageVerifierandActiveSupport::MessageEncryptorconfiguration ofon_rotationcallback.Now both work as documented.
Jean Boussier
Fix
ActiveSupport::MessageVerifierto always be able to verify both URL-safe and URL-unsafe payloads.This is to allow transitioning seemlessly from either configuration without immediately invalidating
all previously generated signed messages.
Jean Boussier, Florent Beaurain, Ali Sepehri
Fix
cache.fetchto honor the provided expiry when:race_condition_ttlis used.In the above example, the final cache entry would have a 10 seconds TTL instead
of the requested 1 hour.
Dhia
Better handle procs with splat arguments in
set_callback.Radamés Roriz
Fix
String#mb_charsto not mutate the receiver.Previously it would call
force_encodingon the receiver,now it dups the receiver first.
Jean Boussier
Improve
ErrorSubscriberto also mark error causes as reported.This avoid some cases of errors being reported twice, notably in views because of how
errors are wrapped in
ActionView::Template::Error.Jean Boussier
Fix
Module#module_parent_nameto return the correct name after the module has been named.When called on an anonymous module, the return value wouldn't change after the module was given a name
later by being assigned to a constant.
Jean Boussier
Fix a bug in
ERB::Util.tokenizethat causes incorrect tokenization when ERB tags are preceeded by multibyte characters.Martin Emde
Active Model
Fix
has_secure_passwordto perform confirmation validation of the password even when blank.The validation was incorrectly skipped when the password only contained whitespace characters.
Fabio Sangiovanni
Handle missing attributes for
ActiveModel::Translation#human_attribute_name.zzak
Fix
ActiveModel::AttributeAssignment#assign_attributesto accept objects withouteach.Kouhei Yanagita
Active Record
Fix SQLite3 data loss during table alterations with CASCADE foreign keys.
When altering a table in SQLite3 that is referenced by child tables with
ON DELETE CASCADEforeign keys, ActiveRecord would silently delete alldata from the child tables. This occurred because SQLite requires table
recreation for schema changes, and during this process the original table
is temporarily dropped, triggering CASCADE deletes on child tables.
The root cause was incorrect ordering of operations. The original code
wrapped
disable_referential_integrityinside a transaction, butPRAGMA foreign_keyscannot be modified inside a transaction in SQLite -attempting to do so simply has no effect. This meant foreign keys remained
enabled during table recreation, causing CASCADE deletes to fire.
The fix reverses the order to follow the official SQLite 12-step ALTER TABLE
procedure:
disable_referential_integritynow wraps the transaction insteadof being wrapped by it. This ensures foreign keys are properly disabled
before the transaction starts and re-enabled after it commits, preventing
CASCADE deletes while maintaining data integrity through atomic transactions.
Ruy Rocha
Fix
belongs_toassociations not to clear the entire composite primary key.When clearing a
belongs_toassociation that references a model with composite primary key,only the optional part of the key should be cleared.
zzak
Fix invalid records being autosaved when distantly associated records are marked for deletion.
Ian Terrell, axlekb AB
Prevent persisting invalid record.
Edouard Chin
Fix count with group by qualified name on loaded relation.
Ryuta Kamizono
Fix
sumwith qualified name on loaded relation.Chris Gunther
Fix prepared statements on mysql2 adapter.
Jean Boussier
Fix query cache for pinned connections in multi threaded transactional tests.
When a pinned connection is used across separate threads, they now use a separate cache store
for each thread.
This improve accuracy of system tests, and any test using multiple threads.
Heinrich Lee Yu, Jean Boussier
Don't add
id_valueattribute alias when attribute/column with that name already exists.Rob Lewis
Fix false positive change detection involving STI and polymorhic has one relationships.
Polymorphic
has_onerelationships would always be considered changed when defined in a STI childclass, causing nedless extra autosaves.
David Fritsch
Fix stale associaton detection for polymophic
belong_to.Florent Beaurain, Thomas Crambert
Fix removal of PostgreSQL version comments in
structure.sqlfor latest PostgreSQL versions which include\restrict.Brendan Weibrecht
Fix
#mergewith#oror#andand a mixture of attributes and SQL strings resulting in an incorrect query.Before:
After:
Joshua Young
Fix inline
has_and_belongs_to_manyfixtures for tables with composite primary keys.fatkodima
Fix
annotatecomments to propagate toupdate_all/delete_all.fatkodima
Fix checking whether an unpersisted record is
include?d in a strictlyloaded
has_and_belongs_to_manyassociation.Hartley McGuire
Fix inline has_and_belongs_to_many fixtures for tables with composite primary keys.
fatkodima
create_or_find_bywill now correctly rollback a transaction.When using
create_or_find_by, raising a ActiveRecord::Rollback errorin a
after_savecallback had no effect, the transaction was committedand a record created.
Edouard Chin
Gracefully handle
Timeout.timeoutfiring during connection configuration.Use of
Timeout.timeoutcould result in improperly initialized database connection.This could lead to a partially configured connection being used, resulting in various exceptions,
the most common being with the PostgreSQLAdapter raising
undefined method 'key?' for nilor
TypeError: wrong argument type nil (expected PG::TypeMap).Jean Boussier
The SQLite3 adapter quotes non-finite Numeric values like "Infinity" and "NaN".
Mike Dalessio
Handle libpq returning a database version of 0 on no/bad connection in
PostgreSQLAdapter.Before, this version would be cached and an error would be raised during connection configuration when
comparing it with the minimum required version for the adapter. This meant that the connection could
never be successfully configured on subsequent reconnection attempts.
Now, this is treated as a connection failure consistent with libpq, raising a
ActiveRecord::ConnectionFailedand ensuring the version isn't cached, which allows the version to be retrieved on the next connection attempt.
Joshua Young, Rian McGuire
Fix error handling during connection configuration.
Active Record wasn't properly handling errors during the connection configuration phase.
This could lead to a partially configured connection being used, resulting in various exceptions,
the most common being with the PostgreSQLAdapter raising
undefined methodkey?' for nilorTypeError: wrong argument type nil (expected PG::TypeMap)`.Jean Boussier
Fix a case where a non-retryable query could be marked retryable.
Hartley McGuire
Handle circular references when autosaving associations.
zzak
Prevent persisting invalid record.
Edouard Chin
Fix support for PostgreSQL enum types with commas in their name.
Arthur Hess
Fix inserts on MySQL with no RETURNING support for a table with multiple auto populated columns.
Nikita Vasilevsky
Fix joining on a scoped association with string joins and bind parameters.
The above example would result in
ActiveRecord::StatementInvalidbecause theactivescope bind parameters would be lost.Jean Boussier
Fix a potential race condition with system tests and transactional fixtures.
Sjoerd Lagarde
Fix count with group by qualified name on loaded relation.
Ryuta Kamizono
Fix sum with qualified name on loaded relation.
Chris Gunther
Fix autosave associations to no longer validated unmodified associated records.
Active Record was incorrectly performing validation on associated record that
weren't created nor modified as part of the transaction:
Jean Boussier
Remember when a database connection has recently been verified (for
two seconds, by default), to avoid repeated reverifications during a
single request.
This should recreate a similar rate of verification as in Rails 7.1,
where connections are leased for the duration of a request, and thus
only verified once.
Matthew Draper
Fix prepared statements on mysql2 adapter.
Jean Boussier
Fix a race condition in
ActiveRecord::Base#method_missingwhen lazily defining attributes.If multiple thread were concurrently triggering attribute definition on the same model,
it could result in a
NoMethodErrorbeing raised.Jean Boussier
Fix MySQL default functions getting dropped when changing a column's nullability.
Bastian Bartmann
Fix
add_unique_constraint/add_check_constraint//add_foreign_key` to be revertible whengiven invalid options.
fatkodima
Fix asynchronous destroying of polymorphic
belongs_toassociations.fatkodima
NOT VALID constraints should not dump in
create_table.Ryuta Kamizono
Fix finding by nil composite primary key association.
fatkodima
Fix parsing of SQLite foreign key names when they contain non-ASCII characters
Zacharias Knudsen
Fix parsing of MySQL 8.0.16+ CHECK constraints when they contain new lines.
Steve Hill
Ensure normalized attribute queries use
IS NULLconsistently forniland normalizednilvalues.Joshua Young
Restore back the ability to pass only database name for
DATABASE_URL.fatkodima
Fix
orderwith using association name as an alias.Ryuta Kamizono
Improve invalid argument error for with.
Ryuta Kamizono
Deduplicate
withCTE expressions.fatkodima
Action View
Fix
javascript_include_tagtypeoption to accept either strings and symbols.Previously, only the string value was recoginized.
Jean Boussier
Fix
excerpthelper with non-whitespace separator.Jonathan Hefner
Respect
html_options[:form]whencollection_checkboxesgenerates thehidden
<input>.Riccardo Odone
Layouts have access to local variables passed to
render.This fixes #31680 which was a regression in Rails 5.1.
Mike Dalessio
Argument errors related to strict locals in templates now raise an
ActionView::StrictLocalsError, and all other argument errors are reraised as-is.Previously, any
ArgumentErrorraised during template rendering was swallowed during strictlocal error handling, so that an
ArgumentErrorunrelated to strict locals (e.g., a helpermethod invoked with incorrect arguments) would be replaced by a similar
ArgumentErrorwith anunrelated backtrace, making it difficult to debug templates.
Now, any
ArgumentErrorunrelated to strict locals is reraised, preserving the originalbacktrace for developers.
Also note that
ActionView::StrictLocalsErroris a subclass ofArgumentError, so any existingcode that rescues
ArgumentErrorwill continue to work.Fixes #52227.
Mike Dalessio
Fix stack overflow error in dependency tracker when dealing with circular dependencies
Jean Boussier
Fix a crash in ERB template error highlighting when the error occurs on a
line in the compiled template that is past the end of the source template.
Martin Emde
Improve reliability of ERB template error highlighting.
Fix infinite loops and crashes in highlighting and
improve tolerance for alternate ERB handlers.
Martin Emde
Action Pack
Submit test requests using
as: :htmlwithContent-Type: x-www-form-urlencodedSean Doyle
Address
rack 3.2deprecations warnings.Rails API will transparently convert one into the other for the forseable future.
Earlopain, Jean Boussier
Always return empty body for HEAD requests in
PublicExceptionsandDebugExceptions.This is required by
Rack::Lint(per RFC9110).Hartley McGuire
Fix
url_forto handle:path_paramsgracefully when it's not aHash.Prevents various security scanners from causing exceptions.
Martin Emde
Fix
ActionDispatch::Executorto unwrap exceptions like other error reporting middlewares.Jean Boussier
Fix NoMethodError when a non-string CSRF token is passed through headers.
Ryan Heneise
Fix invalid response when rescuing
ActionController::Redirecting::UnsafeRedirectErrorin a controller.Alex Ghiculescu
Active Job
Include the actual Active Job locale when serializing rather than I18n locale.
Adrien S
Avoid crashing in Active Job logger when logging enqueueing errors
ActiveJob.perform_all_latercould fail with aTypeErrorwhen allprovided jobs failed to be enqueueed.
Efstathios Stivaros
Action Mailer
Action Cable
Fixed compatibility with
redisgem5.4.1Jean Boussier
Fixed a possible race condition in
stream_from.OuYangJinTing
Ensure the Postgresql adapter always use a dedicated connection even during system tests.
Fix an issue with the Action Cable Postgresql adapter causing deadlock or various weird
pg client error during system tests.
Jean Boussier
Active Storage
Fix
config.active_storage.touch_attachment_recordsto work with eager loading.fatkodima
A Blob will no longer autosave associated Attachment.
This fixes an issue where a record with an attachment would have
its dirty attributes reset, preventing your
after commitcallbackson that record to behave as expected.
Note that this change doesn't require any changes on your application
and is supposed to be internal. Active Storage Attachment will continue
to be autosaved (through a different relation).
Edouard-chin
Action Mailbox
Action Text
Railties
Use
secret_key_basefrom ENV or credentials when present locally.When ENV["SECRET_KEY_BASE"] or
Rails.application.credentials.secret_key_baseis set for test ordevelopment, it is used for the
Rails.config.secret_key_base,instead of generating a
tmp/local_secret.txtfile.Petrik de Heus
Guides
Configuration
📅 Schedule: Branch creation - At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday ( * 0-4,22-23 * * 1-5 ), Only on Sunday and Saturday ( * * * * 0,6 ) (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.