Skip to content

Releases: rails/rails

8.0.2

12 Mar 03:06
v8.0.2
3235827
Compare
Choose a tag to compare

Active Support

  • Fix setting to_time_preserves_timezone from new_framework_defaults_8_0.rb.

    fatkodima

  • Fix Active Support Cache fetch_multi when local store is active.

    fetch_multi now 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 SystemStackError or NoMemoryError happens,
    the error reporter should be able to report these kinds of exceptions.

    Gannon McGibbon

  • Fix RedisCacheStore and MemCacheStore to also handle connection pool related errors.

    These errors are rescued and reported to Rails.error.

    Jean Boussier

  • Fix ActiveSupport::Cache#read_multi to respect version expiry when using local cache.

    zzak

  • Fix ActiveSupport::MessageVerifier and ActiveSupport::MessageEncryptor configuration of on_rotation callback.

    verifier.rotate(old_secret).on_rotation { ... }

    Now both work as documented.

    Jean Boussier

  • Fix ActiveSupport::MessageVerifier to 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.fetch to honor the provided expiry when :race_condition_ttl is 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_chars to not mutate the receiver.

    Previously it would call force_encoding on the receiver,
    now it dups the receiver first.

    Jean Boussier

  • Improve ErrorSubscriber to 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_name to 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

Active Model

  • No changes.

Active Record

  • Fix inverting rename_enum_value when :from/:to are provided.

    fatkodima

  • Prevent persisting invalid record.

    Edouard Chin

  • Fix inverting drop_table without options.

    fatkodima

  • Fix count with group by qualified name on loaded relation.

    Ryuta Kamizono

  • Fix sum with qualified name on loaded relation.

    Chris Gunther

  • 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::ConnectionFailed
    and 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 method key?' 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

  • PoolConfig no longer keeps a reference to the connection class.

    Keeping a reference to the class caused subtle issues when combined with reloading in
    development. Fixes #54343.

    Mike Dalessio

  • Fix SQL notifications sometimes not sent when using async queries.

    Post.async_count
    ActiveSupport::Notifications.subscribed(->(*) { "Will never reach here" }) do
      Post.count
    end

    In rare circumstances and under the right race condition, Active Support notifications
    would no longer be dispatched after using an asynchronous query.
    This is now fixed.

    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.

    class Instructor < ActiveRecord::Base
      has_many :instructor_roles, -> { active }
    end
    
    class InstructorRole < ActiveRecord::Base
      scope :active, -> {
        joins("JOIN students ON instructor_roles.student_id = students.id")
        .where(students { status: 1 })
      }
    end
    
    Instructor.joins(:instructor_roles).first

    The above example would result in ActiveRecord::StatementInvalid because the
    active scope bind parameters would be lost.

    Jean Boussier

  • Fix a potential race condition with system tests and transactional fixtures.

    Sjoerd Lagarde

  • 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:

    Post.create!(author: User.find(1)) # Fail if user is invalid

    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

Action View

  • Respect html_options[:form] when collection_checkboxes generates the
    hidden <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 ArgumentError raised during template rendering was swallowed during strict
    local error handling, so that an ArgumentError unrelated to strict locals (e.g., a helper
    method invoked with incorrect arguments) would be replaced by a similar ArgumentError with an
    unrelated backtrace, making it difficult to debug templates.

    Now, any ArgumentError unrelated to strict locals is reraised, preserving the original
    backtrace for developers.

    Also note that ActionView::StrictLocalsError is a subclass of ArgumentError, so any existing
    code that rescues ArgumentError will continue to work.

    Fixes #52227.

    Mike Dalessio

  • Fix stack overflow error in dependency tracker when dealing with circular dependencies

    Jean Boussier

Action Pack

  • Improve with_routing test helper to not rebuild the middleware stack.

    Otherwise some middleware configuration could be lost.

    Édouard Chin

  • Add resource name to the ArgumentError that's raised when invalid :only or :except options are given to #resource or #resources

    This makes it easier to locate the source of the problem, especially for routes drawn by gems.

    Before:

    :only and :except must include only [:index, :create, :new, :show, :update, :destroy, :edit], but also included [:foo, :bar]
    

    After:

    Route `resources :products` - :only and :except must include only [:index, :create, :new, :show, :update, :destroy, :edit], but also included [:foo, :bar]
    

    Jeremy Green

  • Fix url_for to handle :path_params gracefully when it's not a Hash.

    Prevents various security scanners from causing exceptions.

    Martin Emde

  • Fix ActionDispatch::Executor to unwrap exceptions like other error reporting middlewares.

    Jean Boussier

Active Job

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • 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 commit callbacks
    on 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

Ac...

Read more

8.0.1

13 Dec 20:01
v8.0.1
cf6ff17
Compare
Choose a tag to compare

Active Support

  • Fix a bug in ERB::Util.tokenize that causes incorrect tokenization when ERB tags are preceeded by multibyte characters.

    Martin Emde

  • Restore the ability to decorate methods generated by class_attribute.

    It always has been complicated to use Module#prepend or an alias method chain
    to decorate methods defined by class_attribute, but became even harder in 8.0.

    This capability is now supported for both reader and writer methods.

    Jean Boussier

Active Model

  • No changes.

Active Record

  • Fix removing foreign keys with :restrict action for MySQ

    fatkodima

  • Fix a race condition in ActiveRecord::Base#method_missing when lazily defining attributes.

    If multiple thread were concurrently triggering attribute definition on the same model,
    it could result in a NoMethodError being 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 when given invalid options.

    fatkodima

  • Fix asynchronous destroying of polymorphic belongs_to associations.

    fatkodima

  • Fix insert_all to not update existing records.

    fatkodima

  • NOT VALID constraints should not dump in create_table.

    Ryuta Kamizono

  • Fix finding by nil composite primary key association.

    fatkodima

  • Properly reset composite primary key configuration when setting a primary key.

    fatkodima

  • Fix Mysql2Adapter support for prepared statements

    Using prepared statements with MySQL could result in a NoMethodError exception.

    Jean Boussier, Leo Arnold, zzak

  • 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 NULL consistently for nil and normalized nil values.

    Joshua Young

  • Fix sum when performing a grouped calculation.

    User.group(:friendly).sum no longer worked. This is fixed.

    Edouard Chin

  • Restore back the ability to pass only database name to DATABASE_URL.

    fatkodima

Action View

  • 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

  • Add ActionDispatch::Request::Session#store method to conform Rack spec.

    Yaroslav

Active Job

  • Avoid crashing in Active Job logger when logging enqueueing errors

    ActiveJob.perform_all_later could fail with a TypeError when all
    provided jobs failed to be enqueueed.

    Efstathios Stivaros

Action Mailer

  • No changes.

Action Cable

  • 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

  • No changes.

Action Mailbox

  • No changes.

Action Text

  • No changes.

Railties

  • Skip generation system tests related code for CI when --skip-system-test is given.

    fatkodima

  • Don't add bin/thrust if thruster is not in Gemfile.

    Étienne Barrié

  • Don't install a package for system test when applications don't use it.

    y-yagi

Guides

  • No changes.

8.0.0.1

10 Dec 21:45
v8.0.0.1
Compare
Choose a tag to compare

Active Support

  • No changes.

Active Model

  • No changes.

Active Record

  • No changes.

Action View

  • No changes.

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

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • No changes.

Action Mailbox

  • No changes.

Action Text

  • Update vendored trix version to 2.1.10

    John Hawthorn

Railties

  • No changes.

Guides

  • No changes.

7.2.2.1

10 Dec 21:41
v7.2.2.1
Compare
Choose a tag to compare

Active Support

  • No changes.

Active Model

  • No changes.

Active Record

  • No changes.

Action View

  • No changes.

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

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • No changes.

Action Mailbox

  • No changes.

Action Text

  • Update vendored trix version to 2.1.10

    John Hawthorn

Railties

  • No changes.

Guides

  • No changes.

7.1.5.1

10 Dec 21:26
v7.1.5.1
Compare
Choose a tag to compare

Active Support

  • No changes.

Active Model

  • No changes.

Active Record

  • No changes.

Action View

  • No changes.

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

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • No changes.

Action Mailbox

  • No changes.

Action Text

  • Update vendored trix version to 2.1.10

    John Hawthorn

Railties

  • No changes.

Guides

  • No changes.

7.0.8.7

10 Dec 21:21
v7.0.8.7
Compare
Choose a tag to compare

Active Support

  • No changes.

Active Model

  • No changes.

Active Record

  • No changes.

Action View

  • No changes.

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

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • No changes.

Action Mailbox

  • No changes.

Action Text

  • Update vendored trix version to 1.3.4

    John Hawthorn

Railties

  • No changes.

Guides

  • No changes.

8.0.0

07 Nov 22:29
v8.0.0
dd8f718
Compare
Choose a tag to compare

Active Support

  • Remove deprecated support to passing an array of strings to ActiveSupport::Deprecation#warn.

    Rafael Mendonça França

  • Remove deprecated support to setting attr_internal_naming_format with a @ prefix.

    Rafael Mendonça França

  • Remove deprecated ActiveSupport::ProxyObject.

    Rafael Mendonça França

  • Don't execute i18n watcher on boot. It shouldn't catch any file changes initially,
    and unnecessarily slows down boot of applications with lots of translations.

    Gannon McGibbon, David Stosik

  • Fix ActiveSupport::HashWithIndifferentAccess#stringify_keys to stringify all keys not just symbols.

    Previously:

    { 1 => 2 }.with_indifferent_access.stringify_keys[1] # => 2

    After this change:

    { 1 => 2 }.with_indifferent_access.stringify_keys["1"] # => 2

    This change can be seen as a bug fix, but since it behaved like this for a very long time, we're deciding
    to not backport the fix and to make the change in a major release.

    Jean Boussier

  • Include options when instrumenting ActiveSupport::Cache::Store#delete and ActiveSupport::Cache::Store#delete_multi.

    Adam Renberg Tamm

  • Print test names when running rails test -v for parallel tests.

    John Hawthorn, Abeid Ahmed

  • Deprecate Benchmark.ms core extension.

    The benchmark gem will become bundled in Ruby 3.5

    Earlopain

  • ActiveSupport::TimeWithZone#inspect now uses ISO 8601 style time like Time#inspect

    John Hawthorn

  • ActiveSupport::ErrorReporter#report now assigns a backtrace to unraised exceptions.

    Previously reporting an un-raised exception would result in an error report without
    a backtrace. Now it automatically generates one.

    Jean Boussier

  • Add escape_html_entities option to ActiveSupport::JSON.encode.

    This allows for overriding the global configuration found at
    ActiveSupport.escape_html_entities_in_json for specific calls to to_json.

    This should be usable from controllers in the following manner:

    class MyController < ApplicationController
      def index
        render json: { hello: "world" }, escape_html_entities: false
      end
    end

    Nigel Baillie

  • Raise when using key which can't respond to #to_sym in EncryptedConfiguration.

    As is the case when trying to use an Integer or Float as a key, which is unsupported.

    zzak

  • Deprecate addition and since between two Time and ActiveSupport::TimeWithZone.

    Previously adding time instances together such as 10.days.ago + 10.days.ago or 10.days.ago.since(10.days.ago) produced a nonsensical future date. This behavior is deprecated and will be removed in Rails 8.1.

    Nick Schwaderer

  • Support rfc2822 format for Time#to_fs & Date#to_fs.

    Akshay Birajdar

  • Optimize load time for Railtie#initialize_i18n. Filter I18n.load_paths passed to the file watcher to only those
    under Rails.root. Previously the watcher would grab all available locales, including those in gems
    which do not require a watcher because they won't change.

    Nick Schwaderer

  • Add a filter option to in_order_of to prioritize certain values in the sorting without filtering the results
    by these values.

    Igor Depolli

  • Improve error message when using assert_difference or assert_changes with a
    proc by printing the proc's source code (MRI only).

    Richard Böhme, Jean Boussier

  • Add a new configuration value :zone for ActiveSupport.to_time_preserves_timezone and rename the previous true value to :offset. The new default value is :zone.

    Jason Kim, John Hawthorn

  • Align instrumentation payload[:key] in ActiveSupport::Cache to follow the same pattern, with namespaced and normalized keys.

    Frederik Erbs Spang Thomsen

  • Fix travel_to to set usec 0 when with_usec is false and the given argument String or DateTime.

    mopp

Active Model

  • Add :except_on option for validations. Grants the ability to skip validations in specified contexts.

    class User < ApplicationRecord
        #...
        validates :birthday, presence: { except_on: :admin }
        #...
    end
    
    user = User.new(attributes except birthday)
    user.save(context: :admin)

    Drew Bragg

  • Make ActiveModel::Serialization#read_attribute_for_serialization public

    Sean Doyle

  • Add a default token generator for password reset tokens when using has_secure_password.

    class User < ApplicationRecord
      has_secure_password
    end
    
    user = User.create!(name: "david", password: "123", password_confirmation: "123")
    token = user.password_reset_token
    User.find_by_password_reset_token(token) # returns user
    
    # 16 minutes later...
    User.find_by_password_reset_token(token) # returns nil
    
    # raises ActiveSupport::MessageVerifier::InvalidSignature since the token is expired
    User.find_by_password_reset_token!(token)

    DHH

  • Add a load hook active_model_translation for ActiveModel::Translation.

    Shouichi Kamiya

  • Add raise_on_missing_translations option to ActiveModel::Translation.
    When the option is set, human_attribute_name raises an error if a translation of the given attribute is missing.

    # ActiveModel::Translation.raise_on_missing_translations = false
    Post.human_attribute_name("title")
    => "Title"
    
    # ActiveModel::Translation.raise_on_missing_translations = true
    Post.human_attribute_name("title")
    => Translation missing. Options considered were: (I18n::MissingTranslationData)
        - en.activerecord.attributes.post.title
        - en.attributes.title
    
                raise exception.respond_to?(:to_exception) ? exception.to_exception : exception
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Shouichi Kamiya

  • Introduce ActiveModel::AttributeAssignment#attribute_writer_missing

    Provide instances with an opportunity to gracefully handle assigning to an
    unknown attribute:

    class Rectangle
      include ActiveModel::AttributeAssignment
    
      attr_accessor :length, :width
    
      def attribute_writer_missing(name, value)
        Rails.logger.warn "Tried to assign to unknown attribute #{name}"
      end
    end
    
    rectangle = Rectangle.new
    rectangle.assign_attributes(height: 10) # => Logs "Tried to assign to unknown attribute 'height'"

    Sean Doyle

Active Record

  • Fix support for query_cache: false in database.yml.

    query_cache: false would no longer entirely disable the Active Record query cache.

    zzak

  • NULLS NOT DISTINCT works with UNIQUE CONSTRAINT as well as UNIQUE INDEX.

    Ryuta Kamizono

  • The db:prepare task no longer loads seeds when a non-primary database is created.

    Previously, the db:prepare task would load seeds whenever a new database
    is created, leading to potential loss of data if a database is added to an
    existing environment.

    Introduces a new database config property seeds to control whether seeds
    are loaded during db:prepare which defaults to true for primary database
    configs and false otherwise.

    Fixes #53348.

    Mike Dalessio

  • PG::UnableToSend: no connection to the server is now retryable as a connection-related exception

    Kazuma Watanabe

  • Fix strict loading propagation even if statement cache is not used.

    Ryuta Kamizono

  • Allow rename_enum accepts two from/to name arguments as rename_table does so.

    Ryuta Kamizono

  • Remove deprecated support to setting ENV["SCHEMA_CACHE"].

    Rafael Mendonça França

  • Remove deprecated support to passing a database name to cache_dump_filename.

    Rafael Mendonça França

  • Remove deprecated ActiveRecord::ConnectionAdapters::ConnectionPool#connection.

    Rafael Mendonça França

  • Remove deprecated config.active_record.sqlite3_deprecated_warning.

    Rafael Mendonça França

  • Remove deprecated config.active_record.warn_on_records_fetched_greater_than.

    Rafael Mendonça França

  • Remove deprecated support for defining enum with keyword arguments.

    Rafael Mendonça França

  • Remove deprecated support to finding database adapters that aren't registered to Active Record.

    Rafael Mendonça França

  • Remove deprecated config.active_record.allow_deprecated_singular_associations_name.

    Rafael Mendonça França

  • Remove deprecated config.active_record.commit_transaction_on_non_local_return.

    Rafael Mendonça França

  • 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_of
    specified.

    Markus Doits

  • Fix association scopes applying on the incorrect join when using a polymorphic has_many through:.

    Joshua Young

  • Allow ActiveRecord::Base#pluck to accept hash arguments with symbol and string values.

    Post.joins(:comments).pluck(:id, comments: :id)
    Post.joins(:comments).pluck("id", "comments" => "id")

    Joshua Young

  • Make Float distinguish between float4 and float8 in PostgreSQL.

    Fixes #52742

    Ryota Kitazawa, Takayuki Nagatomi

  • Allow drop_table to accept an array of table names.

    This will let you to drop multiple tables in a single call.

    ActiveRecord::Base.le...
Read more

7.2.2

31 Oct 01:44
v7.2.2
Compare
Choose a tag to compare

Active Support

  • Include options when instrumenting ActiveSupport::Cache::Store#delete and ActiveSupport::Cache::Store#delete_multi.

    Adam Renberg Tamm

  • Print test names when running rails test -v for parallel tests.

    John Hawthorn, Abeid Ahmed

Active Model

  • Fix regression in alias_attribute to work with user defined methods.

    alias_attribute would wrongly assume the attribute accessor was generated by Active Model.

    class Person
      include ActiveModel::AttributeMethods
    
      define_attribute_methods :name
      attr_accessor :name
    
      alias_attribute :full_name, :name
    end
    
    person.full_name # => NoMethodError: undefined method `attribute' for an instance of Person

    Jean Boussier

Active Record

  • Fix support for query_cache: false in database.yml.

    query_cache: false would no longer entirely disable the Active Record query cache.

    zzak

  • Set .attributes_for_inspect to :all by 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 server is now retryable as a connection-related exception

    Kazuma 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_of
    specified.

    Markus Doits

  • Fix association scopes applying on the incorrect join when using a polymorphic has_many through:.

    Joshua Young

  • Fix dependent: :destroy for bi-directional has one through association.

    Fixes #50948.

    class Left < ActiveRecord::Base
      has_one :middle, dependent: :destroy
      has_one :right, through: :middle
    end
    
    class Middle < ActiveRecord::Base
      belongs_to :left, dependent: :destroy
      belongs_to :right, dependent: :destroy
    end
    
    class Right < ActiveRecord::Base
      has_one :middle, dependent: :destroy
      has_one :left, through: :middle
    end

    In the above example left.destroy wouldn't destroy its associated Right
    record.

    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.with to accept more than two sub queries.

    Fixes #53110.

    User.with(foo: [User.select(:id), User.select(:id), User.select(:id)]).to_sql
    undefined method `union' for an instance of Arel::Nodes::UnionAll (NoMethodError)

    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 float4 and float8 in PostgreSQL.

    Fixes #52742

    Ryota Kitazawa, Takayuki Nagatomi

  • Fix an issue where .left_outer_joins used with multiple associations that have
    the same child association but different parents does not join all parents.

    Previously, using .left_outer_joins with 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.config is always ready before access.

    Previously, ActiveRecord::Encryption configuration was deferred until ActiveRecord::Base
    was loaded. Therefore, accessing ActiveRecord::Encryption.config properties before
    ActiveRecord::Base was loaded would give incorrect results.

    ActiveRecord::Encryption now has its own loading hook so that its configuration is set as
    soon as needed.

    When ActiveRecord::Base is loaded, even lazily, it in turn triggers the loading of
    ActiveRecord::Encryption, thus preserving the original behavior of having its config ready
    before any use of ActiveRecord::Base.

    Maxime Réty

  • Add TimeZoneConverter#== method, so objects will be properly compared by
    their type, scale, limit & precision.

    Address #52699.

    Ruy Rocha

Action View

  • No changes.

Action Pack

  • Fix non-GET requests not updating cookies in ActionController::TestCase.

    Jon Moss, Hartley McGuire

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.1.5

31 Oct 01:29
v7.1.5
Compare
Choose a tag to compare

Active Support

  • No changes.

Active Model

  • Fix regression in alias_attribute to work with user defined methods.

    alias_attribute would wrongly assume the attribute accessor was generated by Active Model.

    class Person
      include ActiveModel::AttributeMethods
    
      define_attribute_methods :name
      attr_accessor :name
    
      alias_attribute :full_name, :name
    end
    
    person.full_name # => NoMethodError: undefined method `attribute' for an instance of Person

    Jean Boussier

Active Record

  • 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 an issue where .left_outer_joins used with multiple associations that have
    the same child association but different parents does not join all parents.

    Previously, using .left_outer_joins with 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.config is always ready before access.

    Previously, ActiveRecord::Encryption configuration was deferred until ActiveRecord::Base
    was loaded. Therefore, accessing ActiveRecord::Encryption.config properties before
    ActiveRecord::Base was loaded would give incorrect results.

    ActiveRecord::Encryption now has its own loading hook so that its configuration is set as
    soon as needed.

    When ActiveRecord::Base is loaded, even lazily, it in turn triggers the loading of
    ActiveRecord::Encryption, thus preserving the original behavior of having its config ready
    before any use of ActiveRecord::Base.

    Maxime Réty

  • Add TimeZoneConverter#== method, so objects will be properly compared by
    their type, scale, limit & precision.

    Address #52699.

    Ruy Rocha

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

  • No changes.

Railties

  • No changes.

Guides

  • No changes.

8.0.0.rc2

30 Oct 00:31
v8.0.0.rc2
6283314
Compare
Choose a tag to compare
8.0.0.rc2 Pre-release
Pre-release

Active Support

  • No changes.

Active Model

  • No changes.

Active Record

  • NULLS NOT DISTINCT works with UNIQUE CONSTRAINT as well as UNIQUE INDEX.

    Ryuta Kamizono

  • The db:prepare task no longer loads seeds when a non-primary database is created.

    Previously, the db:prepare task would load seeds whenever a new database
    is created, leading to potential loss of data if a database is added to an
    existing environment.

    Introduces a new database config property seeds to control whether seeds
    are loaded during db:prepare which defaults to true for primary database
    configs and false otherwise.

    Fixes #53348.

    Mike Dalessio

  • PG::UnableToSend: no connection to the server is now retryable as a connection-related exception

    Kazuma Watanabe

  • Fix strict loading propagation even if statement cache is not used.

    Ryuta Kamizono

  • Allow rename_enum accepts two from/to name arguments as rename_table does so.

    Ryuta Kamizono

Action View

  • No changes.

Action Pack

  • Fix routes with :: in the path.

    Rafael Mendonça França

  • Maintain Rack 2 parameter parsing behaviour.

    Matthew Draper

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

  • Fix incorrect database.yml with skip_solid.

    Joé Dupuis

  • Set Regexp.timeout to 1s by default to improve security over Regexp Denial-of-Service attacks.

    Rafael Mendonça França

Guides

  • No changes.