-
Notifications
You must be signed in to change notification settings - Fork 0
Update dependency activesupport to v7.2.3 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
renovate
wants to merge
1
commit into
main
Choose a base branch
from
renovate/ruby-on-rails-packages
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f933661 to
144cdc1
Compare
191e8ea to
b5a9be6
Compare
b5a9be6 to
b44fbb6
Compare
b44fbb6 to
c4b6001
Compare
c4b6001 to
dba908b
Compare
dba908b to
a46ed0a
Compare
a46ed0a to
0211a91
Compare
0211a91 to
b861fe6
Compare
b861fe6 to
1567457
Compare
1567457 to
4d9af0b
Compare
4d9af0b to
5e14618
Compare
5e14618 to
88721a1
Compare
88721a1 to
bb57627
Compare
bb57627 to
7434604
Compare
7434604 to
5f2df70
Compare
5f2df70 to
b6e5404
Compare
b6e5404 to
f061ee3
Compare
f061ee3 to
12f4f46
Compare
e15fb40 to
5109d94
Compare
5109d94 to
2931f40
Compare
2931f40 to
f7a36c9
Compare
f7a36c9 to
1ead686
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.0.4.2->7.2.3Release Notes
rails/rails (activesupport)
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
v7.2.2.2: 7.2.2.2Compare Source
Active Support
Active Model
Active Record
Call inspect on ids in RecordNotFound error
[CVE-2025-55193]
Gannon McGibbon, John Hawthorn
Action View
Action Pack
Active Job
Action Mailer
Action Cable
Active Storage
Action Mailbox
Action Text
Railties
Guides
v7.2.2.1: 7.2.2.1Compare Source
Active Support
Active Model
Active Record
Action View
Action Pack
Add validation to content security policies to disallow spaces and semicolons.
Developers should use multiple arguments, and different directive methods instead.
[CVE-2024-54133]
Gannon McGibbon
Active Job
Action Mailer
Action Cable
Active Storage
Action Mailbox
Action Text
Update vendored trix version to 2.1.10
John Hawthorn
Railties
Guides
v7.2.2: 7.2.2Compare Source
Active Support
Include options when instrumenting
ActiveSupport::Cache::Store#deleteandActiveSupport::Cache::Store#delete_multi.Adam Renberg Tamm
Print test names when running
rails test -vfor parallel tests.John Hawthorn, Abeid Ahmed
Active Model
Fix regression in
alias_attributeto work with user defined methods.alias_attributewould wrongly assume the attribute accessor was generated by Active Model.Jean Boussier
Active Record
Fix support for
query_cache: falseindatabase.yml.query_cache: falsewould no longer entirely disable the Active Record query cache.zzak
Set
.attributes_for_inspectto:allby default.For new applications it is set to
[:id]in config/environment/production.rb.In the console all the attributes are always shown.
Andrew Novoselac
PG::UnableToSend: no connection to the serveris now retryable as a connection-related exceptionKazuma Watanabe
Fix marshalling of unsaved associated records in 7.1 format.
The 7.1 format would only marshal associated records if the association was loaded.
But associations that would only contain unsaved records would be skipped.
Jean Boussier
Fix incorrect SQL query when passing an empty hash to
ActiveRecord::Base.insert.David Stosik
Allow to save records with polymorphic join tables that have
inverse_ofspecified.
Markus Doits
Fix association scopes applying on the incorrect join when using a polymorphic
has_many through:.Joshua Young
Fix
dependent: :destroyfor bi-directional has one through association.Fixes #50948.
In the above example
left.destroywouldn't destroy its associatedRightrecord.
Andy Stewart
Properly handle lazily pinned connection pools.
Fixes #53147.
When using transactional fixtures with system tests to similar tools
such as capybara, it could happen that a connection end up pinned by the
server thread rather than the test thread, causing
"Cannot expire connection, it is owned by a different thread"errors.Jean Boussier
Fix
ActiveRecord::Base.withto accept more than two sub queries.Fixes #53110.
The above now works as expected.
fatkodima
Properly release pinned connections with non joinable connections.
Fixes #52973
When running system tests with transactional fixtures on, it could happen that
the connection leased by the Puma thread wouldn't be properly released back to the pool,
causing "Cannot expire connection, it is owned by a different thread" errors in later tests.
Jean Boussier
Make Float distinguish between
float4andfloat8in PostgreSQL.Fixes #52742
Ryota Kitazawa, Takayuki Nagatomi
Fix an issue where
.left_outer_joinsused with multiple associations that havethe same child association but different parents does not join all parents.
Previously, using
.left_outer_joinswith the same child association would only join one of the parents.Now it will correctly join both parents.
Fixes #41498.
Garrett Blehm
Ensure
ActiveRecord::Encryption.configis always ready before access.Previously,
ActiveRecord::Encryptionconfiguration was deferred untilActiveRecord::Basewas loaded. Therefore, accessing
ActiveRecord::Encryption.configproperties beforeActiveRecord::Basewas loaded would give incorrect results.ActiveRecord::Encryptionnow has its own loading hook so that its configuration is set assoon as needed.
When
ActiveRecord::Baseis loaded, even lazily, it in turn triggers the loading ofActiveRecord::Encryption, thus preserving the original behavior of having its config readybefore any use of
ActiveRecord::Base.Maxime Réty
Add
TimeZoneConverter#==method, so objects will be properly compared bytheir type, scale, limit & precision.
Address #52699.
Ruy Rocha
Action View
Action Pack
Fix non-GET requests not updating cookies in
ActionController::TestCase.Jon Moss, Hartley McGuire
Active Job
Action Mailer
Action Cable
Active Storage
Action Mailbox
Action Text
Railties
Guides
v7.2.1.2: 7.2.1.2Compare Source
Active Support
Active Model
Active Record
Action View
Action Pack
Active Job
Action Mailer
Fix NoMethodError in
block_formathelperMichael Leimstaedtner
Action Cable
Active Storage
Action Mailbox
Action Text
Railties
Guides
v7.2.1.1: 7.2.1.1Compare Source
Active Support
Active Model
Active Record
Action View
Action Pack
Avoid regex backtracking in HTTP Token authentication
[CVE-2024-47887]
Avoid regex backtracking in query parameter filtering
[CVE-2024-41128]
Active Job
Action Mailer
Avoid regex backtracking in
block_formathelper[CVE-2024-47889]
Action Cable
Active Storage
Action Mailbox
Action Text
Avoid backtracing in plain_text_for_blockquote_node
[CVE-2024-47888]
Railties
Guides
v7.2.1: 7.2.1Compare Source
Active Support
Active Model
Active Record
Fix detection for
enumcolumns with parallelized tests and PostgreSQL.Rafael Mendonça França
Allow to eager load nested nil associations.
fatkodima
Fix swallowing ignore order warning when batching using
BatchEnumerator.fatkodima
Fix memory bloat on the connection pool when using the Fiber
IsolatedExecutionState.Jean Boussier
Restore inferred association class with the same modularized name.
Justin Ko
Fix
ActiveRecord::Base.inspectto properly explain how to load schema information.Jean Boussier
Check invalid
enumoptions for the new syntax.The options using
_prefix in the old syntax are invalid in the new syntax.Rafael Mendonça França
Fix
ActiveRecord::Encryption::EncryptedAttributeType#typeto returnactual cast type.
Vasiliy Ermolovich
Fix
create_tablewith:auto_incrementoption for MySQL adapter.fatkodima
Action View
Action Pack
Fix
Request#raw_postraisingNoMethodErrorwhenrack.inputisnil.Hartley McGuire
Active Job
Action Mailer
Action Cable
Active Storage
Action Mailbox
Action Text
Strip
contentattribute if the key is present but the value is emptyJeremy Green
Railties
Fix
rails consolefor application with non default application constant.The wrongly assumed the Rails application would be named
AppNamespace::Application,which is the default but not an obligation.
Jean Boussier
Fix the default Dockerfile to include the full sqlite3 package.
Prior to this it only included
libsqlite3, so it wasn't enough torun
rails dbconsole.Jerome Dalbert
Don't update public directory during
app:updatecommand for API-only Applications.y-yagi
Don't add bin/brakeman if brakeman is not in bundle when upgrading an application.
Etienne Barrié
Remove PWA views and routes if its an API only project.
Jean Boussier
Simplify generated Puma configuration
DHH, Rafael Mendonça França
v7.2.0: 7.2.0Compare Source
Active Support
Fix
delegate_missing_to allow_nil: truewhen called with implict selfJean Boussier
Add
loggeras a dependency since it is a bundled gem candidate for Ruby 3.5Earlopain
Define
Digest::UUID.nil_uuid, which returns the so-called nil UUID.Xavier Noria
Support
durationtype inActiveSupport::XmlMini.heka1024
Remove deprecated
ActiveSupport::Notifications::Event#childrenandActiveSupport::Notifications::Event#parent_of?.Rafael Mendonça França
Remove deprecated support to call the following methods without passing a deprecator:
deprecatedeprecate_constantActiveSupport::Deprecation::DeprecatedObjectProxy.newActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.newActiveSupport::Deprecation::DeprecatedConstantProxy.newassert_deprecatedassert_not_deprecatedcollect_deprecationsRafael Mendonça França
Remove deprecated
ActiveSupport::Deprecationdelegation to instance.Rafael Mendonça França
Remove deprecated
SafeBuffer#clone_empty.Rafael Mendonça França
Remove deprecated
#to_default_sfromArray,Date,DateTimeandTime.Rafael Mendonça França
Remove deprecated support to passing
Dalli::Clientinstances toMemCacheStore.Rafael Mendonça França
Remove deprecated
config.active_support.use_rfc4122_namespaced_uuids.Rafael Mendonça França
Remove deprecated
config.active_support.remove_deprecated_time_with_zone_name.Rafael Mendonça França
Remove deprecated
config.active_support.disable_to_s_conversion.Rafael Mendonça França
Remove deprecated support to bolding log text with positional boolean in
ActiveSupport::LogSubscriber#color.Rafael Mendonça França
Remove deprecated constants
ActiveSupport::LogSubscriber::CLEARandActiveSupport::LogSubscriber::BOLD.Rafael Mendonça França
Remove deprecated support for
config.active_support.cache_format_version = 6.1.Rafael Mendonça França
Remove deprecated
:pool_sizeand:pool_timeoutoptions for the cache storage.Rafael Mendonça França
Warn on tests without assertions.
ActiveSupport::TestCasenow warns when tests do not run any assertions.This is helpful in detecting broken tests that do not perform intended assertions.
fatkodima
Support
hexBinarytype inActiveSupport::XmlMini.heka1024
Deprecate
ActiveSupport::ProxyObjectin favor of Ruby's built-inBasicObject.Earlopain
stub_constnow accepts aexists: falseparameter to allow stubbing missing constants.Jean Boussier
Make
ActiveSupport::BacktraceCleanercopy filters and silencers on dup and clone.Previously the copy would still share the internal silencers and filters array,
causing state to leak.
Jean Boussier
Updating Astana with Western Kazakhstan TZInfo identifier.
Damian Nelson
Add filename support for
ActiveSupport::Logger.logger_outputs_to?.Christian Schmidt
Include
IPAddr#prefixwhen serializing anIPAddrusing theActiveSupport::MessagePackserializer.This change is backward and forward compatible — old payloads can
still be read, and new payloads will be readable by older versions of Rails.
Taiki Komaba
Add
default:support forActiveSupport::CurrentAttributes.attribute.Sean Doyle
Yield instance to
Object#withblock.Sean Doyle
Use logical core count instead of physical core count to determine the
default number of workers when parallelizing tests.
Jonathan Hefner
Fix
Time.now/DateTime.now/Date.todayto return results in a system timezone after#travel_to.There is a bug in the current implementation of #travel_to:
it remembers a timezone of its argument, and all stubbed methods start
returning results in that remembered timezone. However, the expected
behavior is to return results in a system timezone.
Aleksei Chernenkov
Add
ErrorReported#unexpectedto report precondition violations.For example:
...
Make the order of read_multi and write_multi notifications for
Cache::Store#fetch_multioperations match the order they are executed in.Adam Renberg Tamm
Make return values of
Cache::Store#writeconsistent.The return value was not specified before. Now it returns
trueon a successful write,nilif there was an error talking to the cache backend, andfalseif the write failedfor another reason (e.g. the key already exists and
unless_exist: truewas passed).Sander Verdonschot
Fix logged cache keys not always matching actual key used by cache action.
Hartley McGuire
Improve error messages of
assert_changesandassert_no_changes.assert_changeserror messages now display objects with.inspectto make it easierto differentiate nil from empty strings, strings from symbols, etc.
assert_no_changeserror messages now surface the actual value.pcreux
Fix
#to_fs(:human_size)to correctly work with negative numbers.Earlopain
Fix
BroadcastLogger#dupso that it duplicates the logger'sbroadcasts.Andrew Novoselac
Fix issue where
bootstrap.rboverwrites thelevelof aBroadcastLogger'sbroadcasts.Andrew Novoselac
Fix compatibility with the
semantic_loggergem.The
semantic_loggergem doesn't behave exactly like stdlib logger in thatSemanticLogger#levelreturns a Symbol while stdlibLogger#levelreturns an Integer.This caused the various
LogSubscriberclasses in Rails to break when assigned aSemanticLoggerinstance.Jean Boussier, ojab
Fix MemoryStore to prevent race conditions when incrementing or decrementing.
Pierre Jambet
Implement
HashWithIndifferentAccess#to_proc.Previously, calling
#to_proconHashWithIndifferentAccessobject used inherited#to_procmethod from the
Hashclass, which was not able to access values using indifferent keys.fatkodima
Active Model
Fix a bug where type casting of string to
TimeandDateTimedoesn'tcalculate minus minute value in TZ offset correctly.
Akira Matsuda
Port the
type_for_attributemethod to Active Model. Classes that includeActiveModel::Attributeswill now provide this method. This method behavesthe same for Active Model as it does for Active Record.
Jonathan Hefner
Active Record
Handle commas in Sqlite3 default function definitions.
Stephen Margheim
Fixes
validates_associatedraising an exception when configured with asingular association and having
index_nested_attribute_errorsenabled.Martin Spickermann
The constant
ActiveRecord::ImmutableRelationhas been deprecated becausewe want to reserve that name for a stronger sense of "immutable relation".
Please use
ActiveRecord::UnmodifiableRelationinstead.Xavier Noria
Add condensed
#inspectforConnectionPool,AbstractAdapter, andDatabaseConfig.Hartley McGuire
Fixed a memory performance issue in Active Record attribute methods definition.
Jean Boussier
Define the new Active Support notification event
start_transaction.active_record.This event is fired when database transactions or savepoints start, and
complements
transaction.active_record, which is emitted when they finish.The payload has the transaction (
:transaction) and the connection (:connection).Xavier Noria
Fix an issue where the IDs reader method did not return expected results
for preloaded associations in models using composite primary keys.
Jay Ang
The payload of
sql.active_recordActive Support notifications now has the current transaction in the:transactionkey.Xavier Noria
The payload of
transaction.active_recordActive Support notifications now has the transaction the event is related to in the:transactionkey.Xavier Noria
Define
ActiveRecord::Transaction#uuid, which returns a UUID for the database transaction. This may be helpful when tracing database activity. These UUIDs are generated only on demand.Xavier Noria
Fix inference of association model on nested models with the same demodularized name.
E.g. with the following setup:
Before,
#postwould infer the model asNested::Post, but now it correctly infersPost.Joshua Young
PostgreSQL
Cidr#change?detects the address prefix change.Taketo Takashima
Change
BatchEnumerator#destroy_allto return the total number of affected rows.Previously, it always returned
nil.fatkodima
Support
touch_allin batches.fatkodima
Add support for
:if_not_existsand:forceoptions tocreate_schema.fatkodima
Fix
index_errorshaving incorrect index in association validation errors.lulalala
Add
index_errors: :nested_attributes_ordermode.This indexes the association validation errors based on the order received by nested attributes setter, and respects the
reject_ifconfiguration. This enables API to provide enough information to the frontend to map the validation errors back to their respective form fields.lulalala
Add
Rails.application.config.active_record.postgresql_adapter_decode_datesto opt out of decoding dates automatically with the postgresql adapter. Defaults to true.Joé Dupuis
Association option
query_constraintsis deprecated in favor offoreign_key.Nikita Vasilevsky
Add
ENV["SKIP_TEST_DATABASE_TRUNCATE"]flag to speed up multi-process test runs on large DBs when all tests run within default transaction.This cuts ~10s from the test run of HEY when run by 24 processes against the 178 tables, since ~4,000 table truncates can then be skipped.
DHH
Added support for recursive common table expressions.
Generates the following SQL:
ClearlyClaire
validate_constraintcan be called in achange_tableblock.ex:
Cody Cutrer
PostgreSQLAdapternow decodes columns of type date toDateinstead of string.Ex:
Joé Dupuis
Strict loading using
:n_plus_one_onlydoes not eagerly load child associations.With this change, child associations are no longer eagerly loaded, to
match intended behavior and to prevent non-deterministic order issues caused
by calling methods like
firstorlast. Asfirstandlastdon't causean N+1 by themselves, calling child associations will no longer raise.
Fixes #49473.
Before:
SELECT * FROM posts WHERE person_id = 1; -- non-deterministic order
SELECT * FROM posts WHERE person_id = 1 ORDER BY id LIMIT 1;
Allow
Sqlite3Adapterto usesqlite3gem version2.x.Mike Dalessio
Allow
ActiveRecord::Base#pluckto accept hash values.Before
After
Raise an
ActiveRecord::ActiveRecordErrorerror when the MySQL database returns an invalid version string.Kevin McPhillips
ActiveRecord::Base.transactionnow yields anActiveRecord::Transactionobject.This allows to register callbacks on it.
Jean Boussier
Add
ActiveRecord::Base.current_transaction.Returns the current transaction, to allow registering callbacks on it.
Jean Boussier
Add
ActiveRecord.after_all_transactions_commitcallback.Useful for code that may run either inside or outside a transaction and needs
to perform work after the state changes have been properly persisted.
In the above example, the block is either executed immediately if called outside
of a transaction, or called after the open transaction is committed.
If the transaction is rolled back, the block isn't called.
Jean Boussier
Add the ability to ignore counter cache columns until they are backfilled.
Starting to use counter caches on existing large tables can be troublesome, because the column
values must be backfilled separately of the column addition (to not lock the table for too long)
and before the use of
:counter_cache(otherwise methods likesize/any?/etc, which usecounter caches internally, can produce incorrect results). People usually use database triggers
or callbacks on child associations while backfilling before introducing a counter cache
configuration to the association.
Now, to safely backfill the column, while keeping the column updated with child records added/removed, use:
While the counter cache is not "active", the methods like
size/any?/etc will not use it,but get the results directly from the database. After the counter cache column is backfilled, simply
remove the
{ active: false }part from the counter cache definition, and it will now be used by thementioned methods.
fatkodima
Retry known idempotent SELECT queries on connection-related exceptions.
SELECT queries we construct by walking the Arel tree and / or with known model attributes
are idempotent and can safely be retried in the case of a connection error. Previously,
adapters such as
TrilogyAdapterwould raiseActiveRecord::ConnectionFailed: Trilogy::EOFErrorwhen encountering a connection error mid-request.
Adrianna Chang
Allow association's
foreign_keyto be composite.query_constraintsoption was the only way to configure a composite foreign key by passing anArray.Now it's possible to pass an Array value as
foreign_keyto achieve the same behavior of an association.Nikita Vasilevsky
Allow association's
primary_keyto be composite.Association's
primary_keycan be composite when derived from associated modelprimary_keyorquery_constraints.Now it's possible to explicitly set it as composite on the association.
Nikita Vasilevsky
Add
config.active_record.permanent_connection_checkoutsetting.Controls whether
ActiveRecord::Base.connectionraises an error, emits a deprecation warning, or neither.ActiveRecord::Base.connectioncheckouts a database connection from the pool and keeps it leased until the end ofthe request or job. This behavior can be undesirable in environments that use many more threads or fibers than there
is available connections.
This configuration can be used to track down and eliminate code that calls
ActiveRecord::Base.connectionandmigrate it to use
ActiveRecord::Base.with_connectioninstead.The default behavior remains unchanged, and there is currently no plans to change the default.
Jean Boussier
Add dirties option to uncached.
This adds a
dirtiesoption toActiveRecord::Base.uncachedandActiveRecord::ConnectionAdapters::ConnectionPool#uncached.When set to
true(the default), writes will clear all query caches belonging to the current thread.When set to
false, writes to the affected connection pool will not clear any query cache.This is needed by Solid Cache so that cache writes do not clear query caches.
Donal McBreen
Deprecate
ActiveRecord::Base.connectionin favor of.lease_connection.The method has been renamed as
lease_connectionto better reflect that the returnedconnection will be held for the duration of the request or job.
This deprecation is a soft deprecation, no warnings will be issued and there is no
current plan to remove the method.
Jean Boussier
Deprecate
ActiveRecord::ConnectionAdapters::ConnectionPool#connection.The method has been renamed as
lease_connectionto better reflect that the returnedconnection will be held for the duration of the request or job.
Jean Boussier
Expose a generic fixture accessor for fixture names that may conflict with Minitest.
Jean Boussier
Using
Model.query_constraintswith a single non-primary-key column used to raise as expected, but with anincorrect error message.
This has been fixed to raise with a more appropriate error message.
Joshua Young
Fix
has_oneassociation autosave setting the foreign key attribute when it is unchanged.This behavior is also inconsistent with autosaving
belongs_toand can have unintended side effects like raisingan
ActiveRecord::ReadonlyAttributeErrorwhen the foreign key attribute is marked as read-only.Joshua Young
Remove deprecated behavior that would rollback a transaction block when exited using
return,breakorthrow.Rafael Mendonça França
Deprecate
Rails.application.config.active_record.commit_transaction_on_non_local_return.Rafael Mendonça França
Remove deprecated support to pass
rewheretoActiveRecord::Relation#merge.Rafael Mendonça França
Remove deprecated support to pass
deferrable: truetoadd_foreign_key.Rafael Mendonça França
Remove deprecated support to quote
ActiveSupport::Duration.Rafael Mendonça França
Remove deprecated
#quote_bound_value.Rafael Mendonça França
Remove deprecated
ActiveRecord::ConnectionAdapters::ConnectionPool#connection_klass.Rafael Mendonça França
Remove deprecated support to apply
#connection_pool_list,#active_connections?,#clear_active_connections!,#clear_reloadable_connections!,#clear_all_connections!and#flush_idle_connections!to the connections poolsfor the current role when the
roleargument isn't provided.Rafael Mendonça França
Remove deprecated
#all_connection_pools.Rafael Mendonça França
Remove deprecated
ActiveRecord::ConnectionAdapters::SchemaCache#data_sources.Rafael Mendonça França
Remove deprecated
ActiveRecord::ConnectionAdapters::SchemaCache.load_from.Rafael Mendonça França
Remove deprecated
#all_foreign_keys_valid?from database adapters.Rafael Mendonça França
Remove deprecated support to passing coder and class as second argument to
serialize.Rafael Mendonça França
Remove deprecated support to
ActiveRecord::Base#read_attribute(:id)to return the custom primary key value.Rafael Mendonça França
Remove deprecated
TestFixtures.fixture_path.Rafael Mendonça França
Remove deprecated behavior to support referring to a singular association by its plural name.
Rafael Mendonça França
Deprecate
Rails.application.config.active_record.allow_deprecated_singular_associations_name.Rafael Mendonça França
Remove deprecated support to passing
SchemaMigrationandInternalMetadataclasses as arguments toActiveRecord::MigrationContext.Rafael Mendonça França
Remove deprecated
ActiveRecord::Migration.check_pending!method.Rafael Mendonça França
Remove deprecated
ActiveRecord::LogSubscriber.runtimemethod.Rafael Mendonça França
Remove deprecated
ActiveRecord::LogSubscriber.runtime=method.Rafael Mendonça França
Remove deprecated
ActiveRecord::LogSubscriber.reset_runtimemethod.Rafael Mendonça França
Remove deprecated support to define
explainin the connection adapter with 2 arguments.Rafael Mendonça França
Remove deprecated
ActiveRecord::ActiveJobRequiredError.Rafael Mendonça França
Remove deprecated
ActiveRecord::Base.clear_active_connections!.Rafael Mendonça França
Remove deprecated
ActiveRecord::Base.clear_reloadable_connections!.Rafael Mendonça França
Remove deprecated
ActiveRecord::Base.clear_all_connections!.Rafael Mendonça França
Remove deprecated
ActiveRecord::Base.flush_idle_connections!.Rafael Mendonça França
Remove deprecated
nameargument fromActiveRecord::Base.remove_connection.Rafael Mendonça França
Remove deprecated support to call
alias_attributewith non-existent attribute names.Rafael Mendonça França
Remove deprecated
Rails.application.config.active_record.suppress_multiple_database_warning.Rafael Mendonça França
Add
ActiveRecord::Encryption::MessagePackMessageSerializer.Serialize data to the MessagePack format, for efficient storage in binary columns.
The binary encoding requires around 30% less space than the base64 encoding
used by the default serializer.
Donal McBreen
Add support for encrypting binary columns.
Ensure encryption and decryption pass
Type::Binary::Dataaround for binary data.Previously encrypting binary columns with the
ActiveRecord::Encryption::MessageSerializerincidentally worked for MySQL and SQLite, but not PostgreSQL.
Donal McBreen
Deprecated
ENV["SCHEMA_CACHE"]in favor ofschema_cache_pathin the database configuration.Rafael Mendonça França
Add
ActiveRecord::Base.with_connectionas a shortcut for leasing a connection for a short duration.The leased connection is yielded, and for the duration of the block, any call to
ActiveRecord::Base.connectionwill yield that same connection.
This is useful to perform a few database operations without causing a connection to be leased for the
entire duration of the request or job.
Jean Boussier
Deprecate
config.active_record.warn_on_records_fetched_greater_thannow thatsql.active_recordnotification includes
:row_countfield.Jason Nochlin
The fix ensures that the association is joined using the appropriate join type
(either inner join or left outer join) based on the existing joins in the scope.
This prevents unintentional overrides of existing join types and ensures consistency in the generated SQL queries.
Example:
associatedwill useLEFT JOINinstead of usingJOINFix an issue where
ActiveRecord::Encryptionconfigurations are not ready before the loadingof Active Record models, when an application is eager loaded. As a result, encrypted attributes
could be misconfigured in some cases.
Maxime Réty
Deprecate defining an
enumwith keyword arguments.BAD
GOOD
Add
config.active_record.validate_migration_timestampsoption for validating migration timestamps.When set, validates that the timestamp prefix for a migration is no more than a day ahead of
the timestamp associated with the current time. This is designed to prevent migrations
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, 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.