Releases: rails/rails
7.2.0.beta1
Active Support
-
Support
duration
type inActiveSupport::XmlMini
.heka1024
-
Remove deprecated
ActiveSupport::Notifications::Event#children
andActiveSupport::Notifications::Event#parent_of?
.Rafael Mendonça França
-
Remove deprecated support to call the following methods without passing a deprecator:
deprecate
deprecate_constant
ActiveSupport::Deprecation::DeprecatedObjectProxy.new
ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new
ActiveSupport::Deprecation::DeprecatedConstantProxy.new
assert_deprecated
assert_not_deprecated
collect_deprecations
Rafael Mendonça França
-
Remove deprecated
ActiveSupport::Deprecation
delegation to instance.Rafael Mendonça França
-
Remove deprecated
SafeBuffer#clone_empty
.Rafael Mendonça França
-
Remove deprecated
#to_default_s
fromArray
,Date
,DateTime
andTime
.Rafael Mendonça França
-
Remove deprecated support to passing
Dalli::Client
instances 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::CLEAR
andActiveSupport::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_size
and:pool_timeout
options for the cache storage.Rafael Mendonça França
-
Warn on tests without assertions.
ActiveSupport::TestCase
now warns when tests do not run any assertions.
This is helpful in detecting broken tests that do not perform intended assertions.fatkodima
-
Support
hexBinary
type inActiveSupport::XmlMini
.heka1024
-
Deprecate
ActiveSupport::ProxyObject
in favor of Ruby's built-inBasicObject
.Earlopain
-
stub_const
now accepts aexists: false
parameter to allow stubbing missing constants.Jean Boussier
-
Make
ActiveSupport::BacktraceCleaner
copy 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?
.logger = Logger.new('/var/log/rails.log') ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log')
Christian Schmidt
-
Include
IPAddr#prefix
when serializing anIPAddr
using the
ActiveSupport::MessagePack
serializer.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
.class Current < ActiveSupport::CurrentAttributes attribute :counter, default: 0 end
Sean Doyle
-
Remove deprecated support for the pre-Ruby 2.4 behavior of
to_time
returning aTime
object with local timezone.Rafael Mendonça França
-
Deprecate
config.active_support.to_time_preserves_timezone
.Rafael Mendonça França
-
Deprecate
DateAndTime::Compatibility.preserve_timezone
.Rafael Mendonça França
-
Yield instance to
Object#with
block.client.with(timeout: 5_000) do |c| c.get("/commits") end
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.today
to 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#unexpected
to report precondition violations.For example:
def edit if published? Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible") return false end # ... end
The above will raise an error in development and test, but only report the error in production.
Jean Boussier
-
Make the order of read_multi and write_multi notifications for
Cache::Store#fetch_multi
operations match the order they are executed in.Adam Renberg Tamm
-
Make return values of
Cache::Store#write
consistent.The return value was not specified before. Now it returns
true
on a successful write,
nil
if there was an error talking to the cache backend, andfalse
if the write failed
for another reason (e.g. the key already exists andunless_exist: true
was passed).Sander Verdonschot
-
Fix logged cache keys not always matching actual key used by cache action.
Hartley McGuire
-
Improve error messages of
assert_changes
andassert_no_changes
.assert_changes
error messages now display objects with.inspect
to make it easier
to differentiate nil from empty strings, strings from symbols, etc.
assert_no_changes
error messages now surface the actual value.pcreux
-
Fix
#to_fs(:human_size)
to correctly work with negative numbers.Earlopain
-
Fix
BroadcastLogger#dup
so that it duplicates the logger'sbroadcasts
.Andrew Novoselac
-
Fix issue where
bootstrap.rb
overwrites thelevel
of aBroadcastLogger
'sbroadcasts
.Andrew Novoselac
-
Fix compatibility with the
semantic_logger
gem.The
semantic_logger
gem doesn't behave exactly like stdlib logger in that
SemanticLogger#level
returns a Symbol while stdlibLogger#level
returns an Integer.This caused the various
LogSubscriber
classes in Rails to break when assigned a
SemanticLogger
instance.Jean Boussier, ojab
-
Fix MemoryStore to prevent race conditions when incrementing or decrementing.
Pierre Jambet
-
Implement
HashWithIndifferentAccess#to_proc
.Previously, calling
#to_proc
onHashWithIndifferentAccess
object used inherited#to_proc
method from theHash
class, which was not able to access values using indifferent keys.fatkodima
Active Model
-
Fix a bug where type casting of string to
Time
andDateTime
doesn't
calculate minus minute value in TZ offset correctly.Akira Matsuda
-
Port the
type_for_attribute
method to Active Model. Classes that include
ActiveModel::Attributes
will now provide this method. This method behaves
the same for Active Model as it does for Active Record.class MyModel include ActiveModel::Attributes attribute :my_attribute, :integer end MyModel.type_for_attribute(:my_attribute) # => #<ActiveModel::Type::Integer ...>
Jonathan Hefner
Active Record
-
Fix inference of association model on nested models with the same demodularized name.
E.g. with the following setup:
class Nested::Post < ApplicationRecord has_one :post, through: :other end
Before,
#post
would 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_all
to return the total number of affected rows.Previously, it always returned
nil
.fatkodima
-
Support
touch_all
in batches.Post.in_batches.touch_all
fatkodima
-
Add support for
:if_not_exists
and:force
options tocreate_schema
.fatkodima
-
Fix
index_errors
having incorrect index in association validation errors.lulalala
-
Add
index_errors: :nested_attributes_order
mode.This indexes the association validation errors based on the order received by nested attributes setter, and respects the
reject_if
configuration. 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_dates
to opt out of decoding dates automatically with the postgresql adapter. Defaults to true.Joé Dupuis
-
Association option
query_constraints
is 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.
Post.with_recursive( post_and_replies: [ Post.where(id: 42),
...
7.1.3.3
Active Support
- No changes.
Active Model
- No changes.
Active Record
- No changes.
Action View
- No changes.
Action Pack
- No changes.
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
- No changes.
Action Mailbox
- No changes.
Action Text
-
Upgrade Trix to 2.1.1 to fix CVE-2024-34341.
Rafael Mendonça França
Railties
- No changes.
7.0.8.2
Active Support
- No changes.
Active Model
- No changes.
Active Record
- No changes.
Action View
- No changes.
Action Pack
- No changes.
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
- No changes.
Action Mailbox
- No changes.
Action Text
-
Upgrade Trix to 1.3.2 to fix CVE-2024-34341.
Rafael Mendonça França
Railties
- No changes.
v7.1.3.2
Active Support
- No changes.
Active Model
- No changes.
Active Record
- No changes.
Action View
- No changes.
Action Pack
- Fix
raise_on_missing_translations
not working correctly with the
translate
method in controllers after the patch for CVE-2024-26143.
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.
7.1.3.1
Active Support
- No changes.
Active Model
- No changes.
Active Record
- No changes.
Action View
- No changes.
Action Pack
-
Fix possible XSS vulnerability with the
translate
method in controllers -
Fix ReDoS in Accept header parsing
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.
7.0.8.1
Active Support
- No changes.
Active Model
- No changes.
Active Record
- No changes.
Action View
- No changes.
Action Pack
-
Fix possible XSS vulnerability with the
translate
method in controllers
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
-
Disables the session in
ActiveStorage::Blobs::ProxyController
andActiveStorage::Representations::ProxyController
in order to allow caching by default in some CDNs as CloudFlareFixes #44136
Bruno Prieto
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
- No changes.
6.1.7.7
Active Support
- No changes.
Active Model
- No changes.
Active Record
- No changes.
Action View
- No changes.
Action Pack
- No changes.
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
-
Disables the session in
ActiveStorage::Blobs::ProxyController
andActiveStorage::Representations::ProxyController
in order to allow caching by default in some CDNs as CloudFlareFixes #44136
Bruno Prieto
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
- No changes.
7.1.3
Active Support
-
Handle nil
backtrace_locations
inActiveSupport::SyntaxErrorProxy
.Eugene Kenny
-
Fix
ActiveSupport::JSON.encode
to prevent duplicate keys.If the same key exist in both String and Symbol form it could
lead to the same key being emitted twice.Manish Sharma
-
Fix
ActiveSupport::Cache::Store#read_multi
when using a cache namespace
and local cache strategy.Mark Oleson
-
Fix
Time.now/DateTime.now/Date.today
to 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
behaviour is to return results in a system timezone.Aleksei Chernenkov
-
Fix
:unless_exist
option forMemoryStore#write
(et al) when using a
cache namespace.S. Brent Faulkner
-
Fix ActiveSupport::Deprecation to handle blaming generated code.
Jean Boussier, fatkodima
Active Model
- No changes.
Active Record
-
Fix Migrations with versions older than 7.1 validating options given to
add_reference
.Hartley McGuire
-
Ensure
reload
sets correct owner for each association.Dmytro Savochkin
-
Fix view runtime for controllers with async queries.
fatkodima
-
Fix
load_async
to work with query cache.fatkodima
-
Fix polymorphic
belongs_to
to correctly use parent'squery_constraints
.fatkodima
-
Fix
Preloader
to not generate a query for already loaded association withquery_constraints
.fatkodima
-
Fix multi-database polymorphic preloading with equivalent table names.
When preloading polymorphic associations, if two models pointed to two
tables with the same name but located in different databases, the
preloader would only load one.Ari Summer
-
Fix
encrypted_attribute?
to take into account context properties passed toencrypts
.Maxime Réty
-
Fix
find_by
to work correctly in presence of composite primary keys.fatkodima
-
Fix async queries sometimes returning a raw result if they hit the query cache.
ShipPart.async_count
could return a raw integer rather than a Promise
if it found the result in the query cache.fatkodima
-
Fix
Relation#transaction
to not apply a default scope.The method was incorrectly setting a default scope around its block:
Post.where(published: true).transaction do Post.count # SELECT COUNT(*) FROM posts WHERE published = FALSE; end
Jean Boussier
-
Fix calling
async_pluck
on anone
relation.Model.none.async_pluck(:id)
was returning a naked value
instead of a promise.Jean Boussier
-
Fix calling
load_async
on anone
relation.Model.none.load_async
was returning a broken result.Lucas Mazza
-
TrilogyAdapter: ignore
host
ifsocket
parameter is set.This allows to configure a connection on a UNIX socket via DATABASE_URL:
DATABASE_URL=trilogy://does-not-matter/my_db_production?socket=/var/run/mysql.sock
Jean Boussier
-
Fix
has_secure_token
calls the setter method on initialize.Abeid Ahmed
-
Allow using
object_id
as a database column name.
It was available before rails 7.1 and may be used as a part of polymorphic relationship toobject
whereobject
can be any other database record.Mikhail Doronin
-
Fix
rails db:create:all
to not touch databases before they are created.fatkodima
Action View
-
Better handle SyntaxError in Action View.
Mario Caropreso
-
Fix
word_wrap
with empty string.Jonathan Hefner
-
Rename
ActionView::TestCase::Behavior::Content
toActionView::TestCase::Behavior::RenderedViewContent
.Make
RenderedViewContent
inherit fromString
. Make private API with:nodoc:
.Sean Doyle
-
Fix detection of required strict locals.
Further fix
render @collection
compatibility with strict localsJean Boussier
Action Pack
-
Fix including
Rails.application.routes.url_helpers
directly in an
ActiveSupport::Concern.
Jonathan Hefner
-
Fix system tests when using a Chrome binary that has been downloaded by
Selenium.Jonathan Hefner
Active Job
-
Do not trigger immediate loading of
ActiveJob::Base
when loadingActiveJob::TestHelper
.Maxime Réty
-
Preserve the serialized timezone when deserializing
ActiveSupport::TimeWithZone
arguments.Joshua Young
-
Fix ActiveJob arguments serialization to correctly serialize String subclasses having custom serializers.
fatkodima
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
-
Fix N+1 query when fetching preview images for non-image assets.
Aaron Patterson & Justin Searls
-
Fix all Active Storage database related models to respect
ActiveRecord::Base.table_name_prefix
configuration.Chedli Bourguiba
-
Fix
ActiveStorage::Representations::ProxyController
not returning the proper
preview image variant for previewable files.Chedli Bourguiba
-
Fix
ActiveStorage::Representations::ProxyController
to proxy untracked
variants.Chedli Bourguiba
-
Fix direct upload forms when submit button contains nested elements.
Marc Köhlbrugge
-
When using the
preprocessed: true
option, avoid enqueuing transform jobs
for blobs that are not representable.Chedli Bourguiba
-
Process preview image variant when calling
ActiveStorage::Preview#processed
.
For example,attached_pdf.preview(:thumb).processed
will now immediately
generate the full-sized preview image and the:thumb
variant of it.
Previously, the:thumb
variant would not be generated until a further call
to e.g.processed.url
.Chedli Bourguiba and Jonathan Hefner
-
Prevent
ActiveRecord::StrictLoadingViolationError
when strict loading is
enabled and the variant of an Active Storage preview has already been
processed (for example, by callingActiveStorage::Preview#url
).Jonathan Hefner
-
Fix
preprocessed: true
option for named variants of previewable files.Nico Wenterodt
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
-
Make sure
config.after_routes_loaded
hook runs on boot.Rafael Mendonça França
-
Fix
config.log_level
not being respected when using aBroadcastLogger
Édouard Chin
-
Fix isolated engines to take
ActiveRecord::Base.table_name_prefix
into consideration.
This will allow for engine defined models, such as inside Active Storage, to respect
Active Record table name prefix configuration.Chedli Bourguiba
-
The
bin/rails app:template
command will no longer add potentially unwanted
gem platforms viabundle lock --add-platform=...
commands.Jonathan Hefner
7.1.2
Active Support
-
Fix
:expires_in
option forRedisCacheStore#write_multi
.fatkodima
-
Fix deserialization of non-string "purpose" field in Message serializer
Jacopo Beschi
-
Prevent global cache options being overwritten when setting dynamic options
inside aActiveSupport::Cache::Store#fetch
block.Yasha Krasnou
-
Fix missing
require
resulting inNoMethodError
when running
bin/rails secrets:show
orbin/rails secrets:edit
.Stephen Ierodiaconou
-
Ensure
{down,up}case_first
returns non-frozen string.Jonathan Hefner
-
Fix
#to_fs(:human_size)
to correctly work with negative numbers.Earlopain
-
Fix
BroadcastLogger#dup
so that it duplicates the logger'sbroadcasts
.Andrew Novoselac
-
Fix issue where
bootstrap.rb
overwrites thelevel
of aBroadcastLogger
'sbroadcasts
.Andrew Novoselac
-
Fix
ActiveSupport::Cache
to handle outdated Marshal payload from Rails 6.1 format.Active Support's Cache is supposed to treat a Marshal payload that can no longer be
deserialized as a cache miss. It fail to do so for compressed payload in the Rails 6.1
legacy format.Jean Boussier
-
Fix
OrderedOptions#dig
for array indexes.fatkodima
-
Fix time travel helpers to work when nested using with separate classes.
fatkodima
-
Fix
delete_matched
for file cache store to work with keys longer than the
max filename size.fatkodima and Jonathan Hefner
-
Fix compatibility with the
semantic_logger
gem.The
semantic_logger
gem doesn't behave exactly like stdlib logger in that
SemanticLogger#level
returns a Symbol while stdlibLogger#level
returns an Integer.This caused the various
LogSubscriber
classes in Rails to break when assigned a
SemanticLogger
instance.Jean Boussier, ojab
Active Model
-
Make
==(other)
method of AttributeSet safe.Dmitry Pogrebnoy
Active Record
-
Fix renaming primary key index when renaming a table with a UUID primary key
in PostgreSQL.fatkodima
-
Fix
where(field: values)
queries whenfield
is a serialized attribute
(for example, whenfield
usesActiveRecord::Base.serialize
or is a JSON
column).João Alves
-
Prevent marking broken connections as verified.
Daniel Colson
-
Don't mark Float::INFINITY as changed when reassigning it
When saving a record with a float infinite value, it shouldn't mark as changed
Maicol Bentancor
-
ActiveRecord::Base.table_name
now returnsnil
instead of raising
"undefined methodabstract_class?
for Object:Class".a5-stable
-
Fix upserting for custom
:on_duplicate
and:unique_by
consisting of all
inserts keys.fatkodima
-
Fixed an issue where saving a
record could innappropriatelydup
its attributes.Jonathan Hefner
-
Dump schema only for a specific db for rollback/up/down tasks for multiple dbs.
fatkodima
-
Fix
NoMethodError
when casting a PostgreSQLmoney
value that uses a
comma as its radix point and has no leading currency symbol. For example,
when casting"3,50"
.Andreas Reischuck and Jonathan Hefner
-
Re-enable support for using
enum
with non-column-backed attributes.
Non-column-backed attributes must be previously declared with an explicit
type. For example:class Post < ActiveRecord::Base attribute :topic, :string enum topic: %i[science tech engineering math] end
Jonathan Hefner
-
Raise on
foreign_key:
being passed as an array in associationsNikita Vasilevsky
-
Return back maximum allowed PostgreSQL table name to 63 characters.
fatkodima
-
Fix detecting
IDENTITY
columns for PostgreSQL < 10.fatkodima
Action View
-
Fix the
number_to_human_size
view helper to correctly work with negative numbers.Earlopain
-
Automatically discard the implicit locals injected by collection rendering for template that can't accept them
When rendering a collection, two implicit variables are injected, which breaks templates with strict locals.
Now they are only passed if the template will actually accept them.
Yasha Krasnou, Jean Boussier
-
Fix
@rails/ujs
callingstart()
an extra time when using bundlersHartley McGuire, Ryunosuke Sato
-
Fix the
capture
view helper compatibility with HAML and SlimWhen a blank string was captured in HAML or Slim (and possibly other template engines)
it would instead return the entire buffer.Jean Boussier
Action Pack
-
Fix a race condition that could cause a
Text file busy - chromedriver
error with parallel system testsMatt Brictson
-
Fix
StrongParameters#extract_value
to include blank valuesOtherwise composite parameters may not be parsed correctly when one of the
component is blank.fatkodima, Yasha Krasnou, Matthias Eiglsperger
-
Add
racc
as a dependency since it will become a bundled gem in Ruby 3.4.0Hartley McGuire
-
Support handling Enumerator for non-buffered responses.
Zachary Scott
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
- No changes.
Action Mailbox
- No changes.
Action Text
-
Compile ESM package that can be used directly in the browser as actiontext.esm.js
Matias Grunberg
-
Fix using actiontext.js with Sprockets
Matias Grunberg
-
Upgrade Trix to 2.0.7
Hartley McGuire
-
Fix using Trix with Sprockets
Hartley McGuire
Railties
-
Fix running
db:system:change
when app has no Dockerfile.Hartley McGuire
-
If you accessed
config.eager_load_paths
and friends, later changes to
config.paths
were not reflected in the expected auto/eager load paths.
Now, they are.This bug has been latent since Rails 3.
Fixes #49629.
Xavier Noria
7.1.1
Active Support
-
Add support for keyword arguments when delegating calls to custom loggers from
ActiveSupport::BroadcastLogger
.Jenny Shen
-
NumberHelper
: handle objects respondingto_d
.fatkodima
-
Fix RedisCacheStore to properly set the TTL when incrementing or decrementing.
This bug was only impacting Redis server older than 7.0.
Thomas Countz
-
Fix MemoryStore to prevent race conditions when incrementing or decrementing.
Pierre Jambet
Active Model
- No changes.
Active Record
-
Fix auto populating IDENTITY columns for PostgreSQL.
fatkodima
-
Fix "ArgumentError: wrong number of arguments (given 3, expected 2)" when
down migratingrename_table
in older migrations.fatkodima
-
Do not require the Action Text, Active Storage and Action Mailbox tables
to be present when running when running test on CI.Rafael Mendonça França
Action View
-
Updated
@rails/ujs
files to ignore certain data-* attributes when element is contenteditable.This fix was already landed in >= 7.0.4.3, < 7.1.0.
[CVE-2023-23913]Ryunosuke Sato
Action Pack
- No changes.
Active Job
-
Don't log enqueuing details when the job wasn't enqueued.
Dustin Brown
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
- No changes.
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
-
Ensures the Rails generated Dockerfile uses correct ruby version and matches Gemfile.
Abhay Nikam