Releases: rails/rails
8.1.3
Active Support
-
Fix
JSONGemCoderEncoderto correctly serialize custom object hash keys.When hash keys are custom objects whose
as_jsonreturns a Hash,
the encoder now callsto_son the original key object instead of
on theas_jsonresult.Before:
hash = {CustomKey.new(123) => "value"}
hash.to_json # => {"{:id=>123}":"value"}After:
hash.to_json # => {"custom_123":"value"}Dan Sharp
-
Fix inflections to better handle overlapping acronyms.
ActiveSupport::Inflector.inflections(:en) do |inflect| inflect.acronym "USD" inflect.acronym "USDC" end "USDC".underscore # => "usdc"
Said Kaldybaev
-
Silence Dalli 4.0+ warning when using
ActiveSupport::Cache::MemCacheStore.zzak
Active Model
-
Fix Ruby 4.0 delegator warning when calling inspect on attributes.
Hammad Khan
-
Fix
NoMethodErrorwhen deserialisingType::Integerobjects marshalled under Rails 8.0.The performance optimisation that replaced
@rangewith@max/@min
broke Marshal compatibility. Objects serialised under 8.0 (with@range)
and deserialised under 8.1 (expecting@max/@min) would crash with
undefined method '<=' for nilbecauseMarshal.loadrestores instance
variables without callinginitialize.Edward Woodcock
Active Record
-
Fix
insert_allandupsert_alllog message when called on anonymous classes.Gabriel Sobrinho
-
Respect
ActiveRecord::SchemaDumper.ignore_tableswhen dumping SQLite virtual tables.Hans Schnedlitz
-
Restore previous instrumenter after
execute_or_skipFutureResult#execute_or_skipreplaces the thread's instrumenter with an
EventBufferto collect events published during async query execution.
If the global async executor is saturated and thecaller_runsfallback
executes the task on the calling thread, we need to make sure the previous
instrumenter is restored or the staleEventBufferwould stay in place and
permanently swallow all subsequentsql.active_recordnotifications on
that thread.Rosa Gutierrez
-
Bump the minimum PostgreSQL version to 9.5, due to usage of
array_positionfunction.Ivan Kuchin
-
Fix Ruby 4.0 delegator warning when calling inspect on ActiveRecord::Type::Serialized.
Hammad Khan
-
Fix support for table names containing hyphens.
Evgeniy Demin
-
Fix column deduplication for SQLite3 and PostgreSQL virtual (generated) columns.
Column#==andColumn#hashnow account forvirtual?so that the
Deduplicableregistry does not treat a generated column and a regular
column with the same name and type as identical. Previously, if a
generated column was registered first, a regular column on a different
table could be deduplicated to the generated instance, silently
excluding it from INSERT/UPDATE statements.Jay Huber
-
Fix PostgreSQL schema dumping to handle schema-qualified table names in foreign_key references that span different schemas.
# before add_foreign_key "hst.event_log_attributes", "hst.event_logs" # emits correctly because they're in the same schema (hst) add_foreign_key "hst.event_log_attributes", "hst.usr.user_profiles", column: "created_by_id" # emits hst.user.* when user.* is expected # after add_foreign_key "hst.event_log_attributes", "hst.event_logs" add_foreign_key "hst.event_log_attributes", "usr.user_profiles", column: "created_by_id"Chiperific
Action View
-
Fix encoding errors for string locals containing non-ASCII characters.
Kataoka Katsuki
-
Fix collection caching to only forward
expires_inargument if explicitly set.Pieter Visser
Action Pack
- No changes.
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
-
Fix
ActiveStorage::Blobcontent type predicate methods to handlenil.Daichi KUDO
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
-
Add
libvipsto generatedci.ymlConditionally adds
libvipstoci.yml.Steve Polito
Guides
- No changes.
8.0.5
Active Support
-
Fix inflections to better handle overlapping acronyms.
ActiveSupport::Inflector.inflections(:en) do |inflect| inflect.acronym "USD" inflect.acronym "USDC" end "USDC".underscore # => "usdc"
Said Kaldybaev
-
Silence Dalli 4.0+ warning when using
ActiveSupport::Cache::MemCacheStore.zzak
-
Make
delegateanddelegate_missing_towork in BasicObject subclasses.Rafael Mendonça França
-
Fix
ActiveSupport::Inflector.humanizewith international characters.ActiveSupport::Inflector.humanize("áÉÍÓÚ") # => "Áéíóú" ActiveSupport::Inflector.humanize("аБВГДЕ") # => "Абвгде"
Jose Luis Duran
Active Model
- No changes.
Active Record
-
Fix
insert_allandupsert_alllog message when called on anonymous classes.Gabriel Sobrinho
-
Respect
ActiveRecord::SchemaDumper.ignore_tableswhen dumping SQLite virtual tables.Hans Schnedlitz
-
Restore previous instrumenter after
execute_or_skipFutureResult#execute_or_skipreplaces the thread's instrumenter with an
EventBufferto collect events published during async query execution.
If the global async executor is saturated and thecaller_runsfallback
executes the task on the calling thread, we need to make sure the previous
instrumenter is restored or the staleEventBufferwould stay in place and
permanently swallow all subsequentsql.active_recordnotifications on
that thread.Rosa Gutierrez
-
Fix Ruby 4.0 delegator warning when calling inspect on ActiveRecord::Type::Serialized.
Hammad Khan
-
Fix support for table names containing hyphens.
Evgeniy Demin
-
Fix column deduplication for SQLite3 and PostgreSQL virtual (generated) columns.
Column#==andColumn#hashnow account forvirtual?so that the
Deduplicableregistry does not treat a generated column and a regular
column with the same name and type as identical. Previously, if a
generated column was registered first, a regular column on a different
table could be deduplicated to the generated instance, silently
excluding it from INSERT/UPDATE statements.Jay Huber
-
Fix merging relations with arel equality predicates with null relations.
fatkodima
-
Fix SQLite3 schema dump for non-autoincrement integer primary keys.
Previously,
schema.rbshould incorrectly restore that table with an auto incrementing
primary key.Chris Hasiński
-
Fix PostgreSQL
schema_search_pathnot being reapplied afterreset!orreconnect!.The
schema_search_pathconfigured indatabase.ymlis now correctly
reapplied instead of falling back to PostgreSQL defaults.Tobias Egli
-
Ensure batched preloaded associations accounts for klass when grouping to avoid issues with STI.
zzak, Stjepan Hadjic
-
Fix
ActiveRecord::SoleRecordExceeded#recordto return the relation.This was the case until Rails 7.2, but starting from 8.0 it
started mistakenly returning the model class.Jean Boussier
-
Improve PostgreSQLAdapter resilience to Timeout.timeout.
Better handle asynchronous exceptions being thrown inside
thereconnect!method.This may fixes some deep errors such as:
undefined method `key?' for nil:NilClass (NoMethodError) if !type_map.key?(oid)Jean Boussier
-
Fix
eager_loadwhen loadinghas_manyassocations with composite primary keys.This would result in some records being loaded multiple times.
Martin-Alexander
Action View
-
Fix encoding errors for string locals containing non-ASCII characters.
Kataoka Katsuki
-
Fix collection caching to only forward
expires_inargument if explicitly set.Pieter Visser
-
Fix
file_fieldto join mime types with a comma when provided as Arrayfile_field(:article, :image, accept: ['image/png', 'image/gif', 'image/jpeg'])
Now behaves likes:
file_field(:article, :image, accept: 'image/png,image/gif,image/jpeg')Bogdan Gusiev
-
Fix strict locals parsing to handle multiline definitions.
Said Kaldybaev
Action Pack
-
Add
config.action_controller.live_streaming_excluded_keysto control execution state sharing in ActionController::Live.When using ActionController::Live, actions are executed in a separate thread that shares
state from the parent thread. This new configuration allows applications to opt-out specific
state keys that should not be shared.This is useful when streaming inside a
connected_toblock, where you may want
the streaming thread to use its own database connection context.# config/application.rb config.action_controller.live_streaming_excluded_keys = [:active_record_connected_to_stack]
By default, all keys are shared.
Eileen M. Uchitelle
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
-
Fix
ActiveStorage::Blobcontent type predicate methods to handlenil.Daichi KUDO
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
-
Fixed the
rails notescommand to properly extract notes in CSS files.David White
-
Fixed the default Dockerfile to properly include the
vendor/directory duringbundle install.Zhong Sheng
Guides
- No changes.
8.1.2.1
Active Support
-
Reject scientific notation in NumberConverter
Jean Boussier
-
Fix
SafeBuffer#%to preserve unsafe statusJean Boussier
-
Improve performance of NumberToDelimitedConverter
Jean Boussier
Active Model
- No changes.
Active Record
- No changes.
Action View
-
Skip blank attribute names in tag helpers to avoid generating invalid HTML.
Mike Dalessio
Action Pack
-
Fix possible XSS in DebugExceptions middleware
John Hawthorn
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
-
Filter user supplied metadata in DirectUploadController
Jean Boussier
-
Configurable maxmimum streaming chunk size
Makes sure that byte ranges for blobs don't exceed 100mb by default.
Content ranges that are too big can result in denial of service.Gannon McGibbon
-
Limit range requests to a single range
Jean Boussier
-
Prevent path traversal in
DiskService.DiskService#path_fornow raises anInvalidKeyErrorwhen passed keys with dot segments (".",
".."), or if the resolved path is outside the storage root directory.#path_foralso now consistently raisesInvalidKeyErrorif the key is invalid in any way, for
example containing null bytes or having an incompatible encoding. Previously, the exception
raised may have beenArgumentErrororEncoding::CompatibilityError.DiskControllernow explicitly rescuesInvalidKeyErrorwith appropriate HTTP status codes.Mike Dalessio
-
Prevent glob injection in
DiskService#delete_prefixed.Escape glob metacharacters in the resolved path before passing to
Dir.glob.Note that this change breaks any existing code that is relying on
delete_prefixedto expand
glob metacharacters. This change presumes that is unintended behavior (as other storage services
do not respect these metacharacters).Mike Dalessio
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
- No changes.
Guides
- No changes.
8.0.4.1
Active Support
-
Reject scientific notation in NumberConverter
Jean Boussier
-
Fix
SafeBuffer#%to preserve unsafe statusJean Boussier
-
Improve performance of NumberToDelimitedConverter
Jean Boussier
Active Model
- No changes.
Active Record
- No changes.
Action View
-
Skip blank attribute names in tag helpers to avoid generating invalid HTML.
Mike Dalessio
Action Pack
- No changes.
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
-
Filter user supplied metadata in DirectUploadController
Jean Boussier
-
Configurable maxmimum streaming chunk size
Makes sure that byte ranges for blobs don't exceed 100mb by default.
Content ranges that are too big can result in denial of service.Gannon McGibbon
-
Limit range requests to a single range
Jean Boussier
-
Prevent path traversal in
DiskService.DiskService#path_fornow raises anInvalidKeyErrorwhen passed keys with dot segments (".",
".."), or if the resolved path is outside the storage root directory.#path_foralso now consistently raisesInvalidKeyErrorif the key is invalid in any way, for
example containing null bytes or having an incompatible encoding. Previously, the exception
raised may have beenArgumentErrororEncoding::CompatibilityError.DiskControllernow explicitly rescuesInvalidKeyErrorwith appropriate HTTP status codes.Mike Dalessio
-
Prevent glob injection in
DiskService#delete_prefixed.Escape glob metacharacters in the resolved path before passing to
Dir.glob.Note that this change breaks any existing code that is relying on
delete_prefixedto expand
glob metacharacters. This change presumes that is unintended behavior (as other storage services
do not respect these metacharacters).Mike Dalessio
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
- No changes.
Guides
- No changes.
7.2.3.1
Active Support
-
Reject scientific notation in NumberConverter
Jean Boussier
-
Fix
SafeBuffer#%to preserve unsafe statusJean Boussier
-
Improve performance of NumberToDelimitedConverter
Jean Boussier
Active Model
- No changes.
Active Record
- No changes.
Action View
-
Skip blank attribute names in tag helpers to avoid generating invalid HTML.
Mike Dalessio
Action Pack
- No changes.
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
-
Filter user supplied metadata in DirectUploadController
Jean Boussier
-
Configurable maxmimum streaming chunk size
Makes sure that byte ranges for blobs don't exceed 100mb by default.
Content ranges that are too big can result in denial of service.Gannon McGibbon
-
Limit range requests to a single range
Jean Boussier
-
Prevent path traversal in
DiskService.DiskService#path_fornow raises anInvalidKeyErrorwhen passed keys with dot segments (".",
".."), or if the resolved path is outside the storage root directory.#path_foralso now consistently raisesInvalidKeyErrorif the key is invalid in any way, for
example containing null bytes or having an incompatible encoding. Previously, the exception
raised may have beenArgumentErrororEncoding::CompatibilityError.DiskControllernow explicitly rescuesInvalidKeyErrorwith appropriate HTTP status codes.Mike Dalessio
-
Prevent glob injection in
DiskService#delete_prefixed.Escape glob metacharacters in the resolved path before passing to
Dir.glob.Note that this change breaks any existing code that is relying on
delete_prefixedto expand
glob metacharacters. This change presumes that is unintended behavior (as other storage services
do not respect these metacharacters).Mike Dalessio
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
- No changes.
Guides
- No changes.
8.1.2
Active Support
-
Make
delegateanddelegate_missing_towork in BasicObject subclasses.Rafael Mendonça França
-
Fix Inflectors when using a locale that fallbacks to
:en.Said Kaldybaev
-
Fix
ActiveSupport::TimeWithZone#as_jsonto consistently return UTF-8 strings.Previously the returned string would sometime be encoded in US-ASCII, which in
some cases may be problematic.Now the method consistently always return UTF-8 strings.
Jean Boussier
-
Fix
TimeWithZone#xmlschemawhen wrapping aDateTimeinstance in local time.Previously it would return an invalid time.
Dmytro Rymar
-
Implement LocalCache strategy on
ActiveSupport::Cache::MemoryStore. The memory store
needs to respond to the same interface as other cache stores (e.g.ActiveSupport::NullStore).Mikey Gough
-
Fix
ActiveSupport::Inflector.humanizewith international characters.ActiveSupport::Inflector.humanize("áÉÍÓÚ") # => "Áéíóú" ActiveSupport::Inflector.humanize("аБВГДЕ") # => "Абвгде"
Jose Luis Duran
Active Model
- No changes.
Active Record
-
Fix counting cached queries in
ActiveRecord::RuntimeRegistry.fatkodima
-
Fix merging relations with arel equality predicates with null relations.
fatkodima
-
Fix SQLite3 schema dump for non-autoincrement integer primary keys.
Previously,
schema.rbshould incorrectly restore that table with an auto incrementing
primary key.Chris Hasiński
-
Fix PostgreSQL
schema_search_pathnot being reapplied afterreset!orreconnect!.The
schema_search_pathconfigured indatabase.ymlis now correctly
reapplied instead of falling back to PostgreSQL defaults.Tobias Egli
-
Restore the ability of enum to be foats.
enum :rating, { low: 0.0, medium: 0.5, high: 1.0 },
In Rails 8.1.0, enum values are eagerly validated, and floats weren't expected.
Said Kaldybaev
-
Ensure batched preloaded associations accounts for klass when grouping to avoid issues with STI.
zzak, Stjepan Hadjic
-
Fix
ActiveRecord::SoleRecordExceeded#recordto return the relation.This was the case until Rails 7.2, but starting from 8.0 it
started mistakenly returning the model class.Jean Boussier
-
Improve PostgreSQLAdapter resilience to Timeout.timeout.
Better handle asynchronous exceptions being thrown inside
thereconnect!method.This may fixes some deep errors such as:
undefined method `key?' for nil:NilClass (NoMethodError) if !type_map.key?(oid)Jean Boussier
-
Fix structured events for Active Record was not being emitted.
Yuji Yaginuma
-
Fix
eager_loadwhen loadinghas_manyassocations with composite primary keys.This would result in some records being loaded multiple times.
Martin-Alexander
Action View
-
Fix
file_fieldto join mime types with a comma when provided as Arrayfile_field(:article, :image, accept: ['image/png', 'image/gif', 'image/jpeg'])
Now behaves likes:
file_field(:article, :image, accept: 'image/png,image/gif,image/jpeg')Bogdan Gusiev
-
Fix strict locals parsing to handle multiline definitions.
Said Kaldybaev
-
Fix
content_security_policy_nonceerror in mailers when usingcontent_security_policy_nonce_autosetting.The
content_security_policy_nonce helperis provided byActionController::ContentSecurityPolicy, and it relies onrequest.content_security_policy_nonce. Mailers lack both the module and the request object.Jarrett Lusso
Action Pack
-
Add
config.action_controller.live_streaming_excluded_keysto control execution state sharing in ActionController::Live.When using ActionController::Live, actions are executed in a separate thread that shares
state from the parent thread. This new configuration allows applications to opt-out specific
state keys that should not be shared.This is useful when streaming inside a
connected_toblock, where you may want
the streaming thread to use its own database connection context.# config/application.rb config.action_controller.live_streaming_excluded_keys = [:active_record_connected_to_stack]
By default, all keys are shared.
Eileen M. Uchitelle
-
Fix
IpSpoofAttackErrormessage to includeForwardedheader content.Without it, the error message may be misleading.
zzak
Active Job
-
Fix
ActiveJob.perform_all_laterto respectjob_class.enqueue_after_transaction_commit.Previously,
perform_all_laterwould enqueue all jobs immediately, even if
they hadenqueue_after_transaction_commit = true. Now it correctly defers
jobs with this setting until after transaction commits, matching the behavior
ofperform_later.OuYangJinTing
-
Fix using custom serializers with
ActiveJob::Arguments.serializewhen
ActiveJob::Basehasn't been loaded.Hartley McGuire
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
-
Restore ADC when signing URLs with IAM for GCS
ADC was previously used for automatic authorization when signing URLs with IAM.
Now it is again, but the auth client is memoized so that new credentials are only
requested when the current ones expire. Other auth methods can now be used
instead by setting the authorization onActiveStorage::Service::GCSService#iam_client.ActiveStorage::Blob.service.iam_client.authorization = Google::Auth::ImpersonatedServiceAccountCredentials.new(options)
This is safer than setting
Google::Apis::RequestOptions.default.authorization
because it only applies to Active Storage and does not affect other Google API
clients.Justin Malčić
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
-
Skip all system test files on app generation.
Eileen M. Uchitelle
-
Fix
db:system:changeto correctly update Dockerfile base packages.Josiah Smith
-
Fix devcontainer volume mount when app name differs from folder name.
Rafael Mendonça França
-
Fixed the
rails notescommand to properly extract notes in CSS files.David White
-
Fixed the default Dockerfile to properly include the
vendor/directory duringbundle install.Zhong Sheng
Guides
- No changes.
8.1.1
Active Support
- No changes.
Active Model
- No changes.
Active Record
- No changes.
Action View
-
Respect
remove_hidden_field_autocompleteconfig in form builderhidden_field.Rafael Mendonça França
Action Pack
-
Allow methods starting with underscore to be action methods.
Disallowing methods starting with an underscore from being action methods
was an unintended side effect of the performance optimization in
207a254.Fixes #55985.
Rafael Mendonça França
Active Job
-
Only index new serializers.
Jesse Sharps
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
- No changes.
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
-
Do not assume and force SSL in production by default when using Kamal, to allow for out of the box Kamal deployments.
It is still recommended to assume and force SSL in production as soon as you can.
Jerome Dalbert
Guides
- No changes.
8.0.4
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 parallel
test execution, the test suite would hang forever waiting for the dead worker.Joshua Young
-
Fix
NameErrorwhenclass_attributeis defined on instance singleton classes.Previously, calling
class_attributeon an instance's singleton class would raise
aNameErrorwhen accessing the attribute through the instance.object = MyClass.new object.singleton_class.class_attribute :foo, default: "bar" object.foo # previously raised NameError, now returns "bar"
Joshua Young
Active Model
- No changes.
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 all
data 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
wrappeddisable_referential_integrityinside a transaction, but
PRAGMA 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 instead
of 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
-
Add support for bound SQL literals in CTEs.
Nicolas Bachschmidt
-
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
Action View
-
Restore
add_default_name_and_idmethod.Hartley McGuire
Action Pack
-
Submit test requests using
as: :htmlwithContent-Type: x-www-form-urlencodedSean Doyle
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
- No changes.
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
- No changes.
Guides
- No changes.
7.2.3
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 parallel
test 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:
>> {a: 1, b: 2}.with_indifferent_access.transform_keys!(&:succ) => {"c" => 1}
After:
>> {a: 1, b: 2}.with_indifferent_access.transform_keys!(&:succ) => {"c" => 1, "d" => 2}
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 entries
that 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.verifier.rotate(old_secret).on_rotation { ... }
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.cache.fetch("key", expires_in: 1.hour, race_condition_ttl: 5.second) do "something" end
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 inActionView::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.mod = Module.new mod.module_parent_name # => "Object" MyModule::Something = mod mod.module_parent_name # => "MyModule"
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 all
data 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
wrappeddisable_referential_integrityinside a transaction, but
PRAGMA 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 instead
of 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 child
class, 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.base = Comment.joins(:post).where(user_id: 1).where("recent = 1") puts base.merge(base.where(draft: true).or(Post.where(archived: true))).to_sql
Before:
SELECT "comments".* FROM "comments" INNER JOIN "posts" ON "posts"."id" = "comments"."post_id" WHERE (recent = 1) AND ( "comments"."user_id" = 1 AND (recent = 1) AND "comments"."draft" = 1 OR "posts"."archived" = 1 )
After:
SELECT "comments".* FROM "comments" INNER JOIN "posts" ON "posts"."id" = "comments"."post_id" WHERE "comments"."user_id" = 1 AND (recent = 1) AND ( "comments"."user_id" = 1 AND (recent = 1) AND "comments"."draft" = 1 OR "posts"."archived" = 1 )
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 strictly
loadedhas_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 error
in aafter_savecallback had no effect, the transaction was committed
and 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 raisingundefined method 'key?' for nil
orTypeError: wrong argument type nil (expected PG::TypeMap).
...
7.1.6
Active Support
- No changes.
Active Model
- No changes.
Active Record
-
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 raisingundefined methodkey?' for nilorTypeError: wrong argument type nil (expected PG::TypeMap)`.Jean Boussier
-
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 raisingundefined methodkey?' for nilorTypeError: wrong argument type nil (expected PG::TypeMap)`.Jean Boussier
-
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 aNoMethodErrorbeing raised.Jean Boussier
Action View
- No changes.
Action Pack
- No changes.
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
-
Fixed compatibility with
redisgem5.4.1Jean Boussier
Active Storage
- No changes.
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
- No changes.
Guides
- No changes.