Skip to content

Releases: rails/rails

5.2.4.1

18 Dec 19:15
v5.2.4.1
ac30e38
Compare
Choose a tag to compare

Active Support

  • No changes.

Active Model

  • No changes.

Active Record

  • No changes.

Action View

  • No changes.

Action Pack

  • Fix possible information leak / session hijacking vulnerability.

    The ActionDispatch::Session::MemcacheStore is still vulnerable given it requires the
    gem dalli to be updated as well.

    CVE-2019-16782.

Active Job

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • No changes.

Railties

  • No changes.

6.0.2

13 Dec 18:27
v6.0.2
f675cb3
Compare
Choose a tag to compare

Active Support

  • Eager load translations during initialization.

    Diego Plentz

  • Use per-thread CPU time clock on ActiveSupport::Notifications.

    George Claghorn

Active Model

  • No changes.

Active Record

  • Share the same connection pool for primary and replica databases in the
    transactional tests for the same database.

    Edouard Chin

  • Fix the preloader when one record is fetched using after_initialize
    but not the entire collection.

    Bradley Price

  • Fix collection callbacks not terminating when :abort is thrown.

    Edouard Chin, Ryuta Kamizono

  • Correctly deprecate where.not working as NOR for relations.

    12a9664 deprecated where.not working as NOR, however
    doing a relation query like where.not(relation: { ... })
    wouldn't be properly deprecated and where.not would work as
    NAND instead.

    Edouard Chin

  • Fix db:migrate task with multiple databases to restore the connection
    to the previous database.

    The migrate task iterates and establish a connection over each db
    resulting in the last one to be used by subsequent rake tasks.
    We should reestablish a connection to the connection that was
    established before the migrate tasks was run

    Edouard Chin

  • Fix multi-threaded issue for AcceptanceValidator.

    Ryuta Kamizono

Action View

  • No changes.

Action Pack

  • Allow using mountable engine route helpers in System Tests.

    Chalo Fernandez

Active Job

Action Mailer

  • Fix ActionMailer assertions don't work for parameterized mail with legacy delivery job.

    bogdanvlviv

Action Cable

  • No changes.

Active Storage

  • No changes.

Action Mailbox

  • No changes.

Action Text

  • No changes.

Railties

  • Fix the collision check for the scaffold generator.

    Ryan Robeson

6.0.2.rc2

09 Dec 16:24
v6.0.2.rc2
63107e9
Compare
Choose a tag to compare
6.0.2.rc2 Pre-release
Pre-release

Active Support

  • Eager load translations during initialization.

    Diego Plentz

  • Use per-thread CPU time clock on ActiveSupport::Notifications.

    George Claghorn

Active Model

  • No changes.

Active Record

  • Share the same connection pool for primary and replica databases in the
    transactional tests for the same database.

    Edouard Chin

  • Fix the preloader when one record is fetched using after_initialize
    but not the entire collection.

    Bradley Price

  • Fix collection callbacks not terminating when :abort is thrown.

    Edouard Chin, Ryuta Kamizono

  • Correctly deprecate where.not working as NOR for relations.

    12a9664 deprecated where.not working as NOR, however
    doing a relation query like where.not(relation: { ... })
    wouldn't be properly deprecated and where.not would work as
    NAND instead.

    Edouard Chin

  • Fix db:migrate task with multiple databases to restore the connection
    to the previous database.

    The migrate task iterates and establish a connection over each db
    resulting in the last one to be used by subsequent rake tasks.
    We should reestablish a connection to the connection that was
    established before the migrate tasks was run

    Edouard Chin

  • Fix multi-threaded issue for AcceptanceValidator.

    Ryuta Kamizono

Action View

  • No changes.

Action Pack

  • Allow using mountable engine route helpers in System Tests.

    Chalo Fernandez

Active Job

Action Mailer

  • Fix ActionMailer assertions don't work for parameterized mail with legacy delivery job.

    bogdanvlviv

Action Cable

  • No changes.

Active Storage

  • No changes.

Action Mailbox

  • No changes.

Action Text

  • No changes.

Railties

  • Fix the collision check for the scaffold generator.

    Ryan Robeson

6.0.2.rc1

27 Nov 15:25
v6.0.2.rc1
a015f55
Compare
Choose a tag to compare
6.0.2.rc1 Pre-release
Pre-release

Active Support

  • Eager load translations during initialization.

    Diego Plentz

  • Use per-thread CPU time clock on ActiveSupport::Notifications.

    George Claghorn

Active Model

  • No changes.

Active Record

  • Share the same connection pool for primary and replica databases in the
    transactional tests for the same database.

    Edouard Chin

  • Fix the preloader when one record is fetched using after_initialize
    but not the entire colection.

    Bradley Price

  • Fix collection callbacks not terminating when :abort is thrown.

    Edouard Chin, Ryuta Kamizono

  • Correctly deprecate where.not working as NOR for relations.

    12a9664 deprecated where.not working as NOR, however
    doing a relation query like where.not(relation: { ... })
    wouldn't be properly deprecated and where.not would work as
    NAND instead.

    Edouard Chin

  • Fix db:migrate task with multiple databases to restore the connection
    to the previous database.

    The migrate task iterates and establish a connection over each db
    resulting in the last one to be used by subsequent rake tasks.
    We should reestablish a connection to the connection that was
    established before the migrate tasks was run

    Edouard Chin

  • Fix multi-threaded issue for AcceptanceValidator.

    Ryuta Kamizono

Action View

  • No changes.

Action Pack

  • Allow using mountable engine route helpers in System Tests.

    Chalo Fernandez

Active Job

Action Mailer

  • Fix ActionMailer assertions don't work for parameterized mail with legacy delivery job.

    bogdanvlviv

Action Cable

  • No changes.

Active Storage

  • No changes.

Action Mailbox

  • No changes.

Action Text

  • No changes.

Railties

  • Fix the collision check for the scaffold generator.

    Ryan Robeson

  • Configuration files for environments (config/environments/*.rb) are
    now able to modify autoload_paths, autoload_once_paths, and
    eager_load_paths.

    Allen Hsu & Xavier Noria

5.2.4

27 Nov 15:51
v5.2.4
8bec77c
Compare
Choose a tag to compare

Active Support

  • Make ActiveSupport::Logger Fiber-safe. Fixes #36752.

    Use Fiber.current.__id__ in ActiveSupport::Logger#local_level= in order
    to make log level local to Ruby Fibers in addition to Threads.

    Example:

    logger = ActiveSupport::Logger.new(STDOUT)
    logger.level = 1
    p "Main is debug? #{logger.debug?}"
    
    Fiber.new {
      logger.local_level = 0
      p "Thread is debug? #{logger.debug?}"
    }.resume
    
    p "Main is debug? #{logger.debug?}"
    

    Before:

    Main is debug? false
    Thread is debug? true
    Main is debug? true
    

    After:

    Main is debug? false
    Thread is debug? true
    Main is debug? false
    

    Alexander Varnin

Active Model

  • Type cast falsy boolean symbols on boolean attribute as false.

    Fixes #35676.

    Ryuta Kamizono

Active Record

  • Fix circular autosave: true causes invalid records to be saved.

    Prior to the fix, when there was a circular series of autosave: true
    associations, the callback for a has_many association was run while
    another instance of the same callback on the same association hadn't
    finished running. When control returned to the first instance of the
    callback, the instance variable had changed, and subsequent associated
    records weren't saved correctly. Specifically, the ID field for the
    belongs_to corresponding to the has_many was nil.

    Fixes #28080.

    Larry Reid

  • PostgreSQL: Fix GROUP BY with ORDER BY virtual count attribute.

    Fixes #36022.

    Ryuta Kamizono

  • Fix sqlite3 collation parsing when using decimal columns.

    Martin R. Schuster

  • Make ActiveRecord ConnectionPool.connections method thread-safe.

    Fixes #36465.

    Jeff Doering

  • Assign all attributes before calling build to ensure the child record is visible in
    before_add and after_add callbacks for has_many :through associations.

    Fixes #33249.

    Ryan H. Kerr

Action View

  • Allow programmatic click events to trigger Rails UJS click handlers.
    Programmatic click events (eg. ones generated by Rails.fire(link, "click")) don't specify a button. These events were being incorrectly stopped by code meant to ignore scroll wheel and right clicks introduced in #34573.

    Sudara Williams

Action Pack

  • No changes.

Active Job

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • No changes.

Railties

  • Use original bundler environment variables during the process of generating a new rails project.

    Marco Costa

  • Allow loading seeds without ActiveJob.

    Fixes #35782

    Jeremy Weathers

  • Only force :async ActiveJob adapter to :inline during seeding.

    BatedUrGonnaDie

5.2.4.rc1

23 Nov 00:33
v5.2.4.rc1
9e2a341
Compare
Choose a tag to compare
5.2.4.rc1 Pre-release
Pre-release

Active Support

  • Make ActiveSupport::Logger Fiber-safe. Fixes #36752.

    Use Fiber.current.__id__ in ActiveSupport::Logger#local_level= in order
    to make log level local to Ruby Fibers in addition to Threads.

    Example:

    logger = ActiveSupport::Logger.new(STDOUT)
    logger.level = 1
    p "Main is debug? #{logger.debug?}"
    
    Fiber.new {
      logger.local_level = 0
      p "Thread is debug? #{logger.debug?}"
    }.resume
    
    p "Main is debug? #{logger.debug?}"
    

    Before:

    Main is debug? false
    Thread is debug? true
    Main is debug? true
    

    After:

    Main is debug? false
    Thread is debug? true
    Main is debug? false
    

    Alexander Varnin

Active Model

  • Type cast falsy boolean symbols on boolean attribute as false.

    Fixes #35676.

    Ryuta Kamizono

Active Record

  • Fix circular autosave: true causes invalid records to be saved.

    Prior to the fix, when there was a circular series of autosave: true
    associations, the callback for a has_many association was run while
    another instance of the same callback on the same association hadn't
    finished running. When control returned to the first instance of the
    callback, the instance variable had changed, and subsequent associated
    records weren't saved correctly. Specifically, the ID field for the
    belongs_to corresponding to the has_many was nil.

    Fixes #28080.

    Larry Reid

  • PostgreSQL: Fix GROUP BY with ORDER BY virtual count attribute.

    Fixes #36022.

    Ryuta Kamizono

  • Fix sqlite3 collation parsing when using decimal columns.

    Martin R. Schuster

  • Make ActiveRecord ConnectionPool.connections method thread-safe.

    Fixes #36465.

    Jeff Doering

  • Assign all attributes before calling build to ensure the child record is visible in
    before_add and after_add callbacks for has_many :through associations.

    Fixes #33249.

    Ryan H. Kerr

Action View

  • Allow programmatic click events to trigger Rails UJS click handlers.
    Programmatic click events (eg. ones generated by Rails.fire(link, "click")) don't specify a button. These events were being incorrectly stopped by code meant to ignore scroll wheel and right clicks introduced in #34573.

    Sudara Williams

Action Pack

  • No changes.

Active Job

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • No changes.

Railties

  • Use original bundler environment variables during the process of generating a new rails project.

    Marco Costa

  • Allow loading seeds without ActiveJob.

    Fixes #35782

    Jeremy Weathers

  • Only force :async ActiveJob adapter to :inline during seeding.

    BatedUrGonnaDie

6.0.1

05 Nov 14:45
Compare
Choose a tag to compare

Active Support

  • ActiveSupport::SafeBuffer supports Enumerator methods.

    Shugo Maeda

  • The Redis cache store fails gracefully when the server returns a "max number of clients reached" error.

    Brandon Medenwald

  • Fixed that mutating a value returned by a memory cache store would unexpectedly change the cached value.

    Jonathan Hyman

  • The default inflectors in zeitwerk mode support overrides:

    # config/initializers/zeitwerk.rb
    Rails.autoloaders.each do |autoloader|
      autoloader.inflector.inflect(
        "html_parser" => "HTMLParser",
        "ssl_error"   => "SSLError"
      )
    end

    That way, you can tweak how individual basenames are inflected without touching Active Support inflection rules, which are global. These inflectors fallback to String#camelize, so existing inflection rules are still taken into account for non-overridden basenames.

    Please, check the autoloading guide for zeitwerk mode if you prefer not to depend on String#camelize at all.

    Xavier Noria

  • Improve Range#===, Range#include?, and Range#cover? to work with beginless (startless) and endless range targets.

    Allen Hsu, Andrew Hodgkinson

  • Don't use Process#clock_gettime(CLOCK_PROCESS_CPUTIME_ID) on Solaris

    Iain Beeston

Active Model

  • No changes.

Active Record

  • Common Table Expressions are allowed on read-only connections.

    Chris Morris

  • New record instantiation respects unscope.

    Ryuta Kamizono

  • Fixed a case where find_in_batches could halt too early.

    Takayuki Nakata

  • Autosaved associations always perform validations when a custom validation context is used.

    Tekin Suleyman

  • sql.active_record notifications now include the :connection in their payloads.

    Eugene Kenny

  • A rollback encountered in an after_commit callback does not reset previously-committed record state.

    Ryuta Kamizono

  • Fixed that join order was lost when eager-loading.

    Ryuta Kamizono

  • DESCRIBE queries are allowed on read-only connections.

    Dylan Thacker-Smith

  • Fixed that records that had been inspected could not be marshaled.

    Eugene Kenny

  • The connection pool reaper thread is respawned in forked processes. This fixes that idle connections in forked processes wouldn't be reaped.

    John Hawthorn

  • The memoized result of ActiveRecord::Relation#take is properly cleared when ActiveRecord::Relation#reset or ActiveRecord::Relation#reload is called.

    Anmol Arora

  • Fixed the performance regression for primary_keys introduced MySQL 8.0.

    Hiroyuki Ishii

  • insert, insert_all, upsert, and upsert_all now clear the query cache.

    Eugene Kenny

  • Call while_preventing_writes directly from connected_to.

    In some cases application authors want to use the database switching middleware and make explicit calls with connected_to. It's possible for an app to turn off writes and not turn them back on by the time we call connected_to(role: :writing).

    This change allows apps to fix this by assuming if a role is writing we want to allow writes, except in the case it's explicitly turned off.

    Eileen M. Uchitelle

  • Improve detection of ActiveRecord::StatementTimeout with mysql2 adapter in the edge case when the query is terminated during filesort.

    Kir Shatrov

Action View

  • UJS avoids Element.closest() for IE 9 compatibility.

    George Claghorn

Action Pack

  • ActionDispatch::SystemTestCase now inherits from ActiveSupport::TestCase rather than ActionDispatch::IntegrationTest. This permits running jobs in system tests.

    George Claghorn, Edouard Chin

  • Registered MIME types may contain extra flags:

    Mime::Type.register "text/html; fragment", :html_fragment

    Aaron Patterson

Active Job

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • ActiveStorage::AnalyzeJobs are discarded on ActiveRecord::RecordNotFound errors.

    George Claghorn

  • Blobs are recorded in the database before being uploaded to the service. This fixes that generated blob keys could silently collide, leading to data loss.

    Julik Tarkhanov

Action Mailbox

  • No changes.

Action Text

  • No changes.

Railties

  • The zeitwerk:check Rake task reports files outside the app's root directory, as in engines loaded from gems.

    Xavier Noria

  • Fixed a possible error when using the evented file update checker.

    Yuji Yaginuma

  • The sqlite3 database files created by the parallel testing feature are included in the default .gitignore file for newly-generated apps.

    Yasuo Honda

  • rails new generates a .keep file in tmp/pids. This fixes starting a server via rackup instead of rails server.

    Rafael Mendonça França

6.0.1.rc1

31 Oct 20:30
Compare
Choose a tag to compare
6.0.1.rc1 Pre-release
Pre-release

Active Support

  • ActiveSupport::SafeBuffer supports Enumerator methods.

    Shugo Maeda

  • The Redis cache store fails gracefully when the server returns a "max number
    of clients reached" error.

    Brandon Medenwald

  • Fixed that mutating a value returned by a memory cache store would
    unexpectedly change the cached value.

    Jonathan Hyman

  • The default inflectors in zeitwerk mode support overrides:

    # config/initializers/zeitwerk.rb
    Rails.autoloaders.each do |autoloader|
      autoloader.inflector.inflect(
        "html_parser" => "HTMLParser",
        "ssl_error"   => "SSLError"
      )
    end

    That way, you can tweak how individual basenames are inflected without touching Active Support inflection rules, which are global. These inflectors fallback to String#camelize, so existing inflection rules are still taken into account for non-overridden basenames.

    Please, check the autoloading guide for zeitwerk mode if you prefer not to depend on String#camelize at all.

    Xavier Noria

  • Improve Range#===, Range#include?, and Range#cover? to work with beginless (startless)
    and endless range targets.

    Allen Hsu, Andrew Hodgkinson

  • Don't use Process#clock_gettime(CLOCK_PROCESS_CPUTIME_ID) on Solaris

    Iain Beeston

Active Model

  • No changes.

Active Record

  • Common Table Expressions are allowed on read-only connections.

    Chris Morris

  • New record instantiation respects unscope.

    Ryuta Kamizono

  • Fixed a case where find_in_batches could halt too early.

    Takayuki Nakata

  • Autosaved associations always perform validations when a custom validation
    context is used.

    Tekin Suleyman

  • sql.active_record notifications now include the :connection in
    their payloads.

    Eugene Kenny

  • A rollback encountered in an after_commit callback does not reset
    previously-committed record state.

    Ryuta Kamizono

  • Fixed that join order was lost when eager-loading.

    Ryuta Kamizono

  • DESCRIBE queries are allowed on read-only connections.

    Dylan Thacker-Smith

  • Fixed that records that had been inspected could not be marshaled.

    Eugene Kenny

  • The connection pool reaper thread is respawned in forked processes. This
    fixes that idle connections in forked processes wouldn't be reaped.

    John Hawthorn

  • The memoized result of ActiveRecord::Relation#take is properly cleared
    when ActiveRecord::Relation#reset or ActiveRecord::Relation#reload
    is called.

    Anmol Arora

  • Fixed the performance regression for primary_keys introduced MySQL 8.0.

    Hiroyuki Ishii

  • insert, insert_all, upsert, and upsert_all now clear the query cache.

    Eugene Kenny

  • Call while_preventing_writes directly from connected_to.

    In some cases application authors want to use the database switching middleware and make explicit calls with connected_to. It's possible for an app to turn off writes and not turn them back on by the time we call connected_to(role: :writing).

    This change allows apps to fix this by assuming if a role is writing we want to allow writes, except in the case it's explicitly turned off.

    Eileen M. Uchitelle

  • Improve detection of ActiveRecord::StatementTimeout with mysql2 adapter in the edge case when the query is terminated during filesort.

    Kir Shatrov

Action View

  • UJS avoids Element.closest() for IE 9 compatibility.

    George Claghorn

Action Pack

  • ActionDispatch::SystemTestCase now inherits from ActiveSupport::TestCase
    rather than ActionDispatch::IntegrationTest. This permits running jobs in
    system tests.

    George Claghorn, Edouard Chin

  • Registered MIME types may contain extra flags:

    Mime::Type.register "text/html; fragment", :html_fragment

    Aaron Patterson

Active Job

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • ActiveStorage::AnalyzeJobs are discarded on ActiveRecord::RecordNotFound errors.

    George Claghorn

  • Blobs are recorded in the database before being uploaded to the service.
    This fixes that generated blob keys could silently collide, leading to
    data loss.

    Julik Tarkhanov

Action Mailbox

  • No changes.

Action Text

  • No changes.

Railties

  • The zeitwerk:check Rake task reports files outside the app's root
    directory, as in engines loaded from gems.

    Xavier Noria

  • Fixed a possible error when using the evented file update checker.

    Yuji Yaginuma

  • The sqlite3 database files created by the parallel testing feature are
    included in the default .gitignore file for newly-generated apps.

    Yasuo Honda

  • rails new generates a .keep file in tmp/pids. This fixes starting
    a server via rackup instead of rails server.

    Rafael Mendonça França

5.2.3

28 Mar 03:04
v5.2.3
b9ca94c
Compare
Choose a tag to compare

Active Support

  • Add ActiveSupport::HashWithIndifferentAccess#assoc.

    assoc can now be called with either a string or a symbol.

    Stefan Schüßler

  • Fix String#safe_constantize throwing a LoadError for incorrectly cased constant references.

    Keenan Brock

  • Allow Range#=== and Range#cover? on Range

    Range#cover? can now accept a range argument like Range#include? and
    Range#===. Range#=== works correctly on Ruby 2.6. Range#include? is moved
    into a new file, with these two methods.

    utilum

  • If the same block is included multiple times for a Concern, an exception is no longer raised.

    Mark J. Titorenko, Vlad Bokov

Active Model

  • Fix date value when casting a multiparameter date hash to not convert
    from Gregorian date to Julian date.

    Before:

    Day.new({"day(1i)"=>"1", "day(2i)"=>"1", "day(3i)"=>"1"})
    => #<Day id: nil, day: "0001-01-03", created_at: nil, updated_at: nil>
    

    After:

    Day.new({"day(1i)"=>"1", "day(2i)"=>"1", "day(3i)"=>"1"})
    => #<Day id: nil, day: "0001-01-01", created_at: nil, updated_at: nil>
    

    Fixes #28521.

    Sayan Chakraborty

  • Fix numericality equality validation of BigDecimal and Float
    by casting to BigDecimal on both ends of the validation.

    Gannon McGibbon

Active Record

  • Fix different count calculation when using size with manual select with DISTINCT.

    Fixes #35214.

    Juani Villarejo

  • Fix prepared statements caching to be enabled even when query caching is enabled.

    Ryuta Kamizono

  • Don't allow where with invalid value matches to nil values.

    Fixes #33624.

    Ryuta Kamizono

  • Restore an ability that class level update without giving ids.

    Fixes #34743.

    Ryuta Kamizono

  • Fix join table column quoting with SQLite.

    Gannon McGibbon

  • Ensure that delete_all on collection proxy returns affected count.

    Ryuta Kamizono

  • Reset scope after delete on collection association to clear stale offsets of removed records.

    Gannon McGibbon

Action View

  • Prevent non-primary mouse keys from triggering Rails UJS click handlers.
    Firefox fires click events even if the click was triggered by non-primary mouse keys such as right- or scroll-wheel-clicks.
    For example, right-clicking a link such as the one described below (with an underlying ajax request registered on click) should not cause that request to occur.

    <%= link_to 'Remote', remote_path, class: 'remote', remote: true, data: { type: :json } %>
    

    Fixes #34541

    Wolfgang Hobmaier

Action Pack

  • Allow using combine the Cache Control public and no-cache headers.

    Before this change, even if public was specified for Cache Control header,
    it was excluded when no-cache was included. This fixed to keep public
    header as is.

    Fixes #34780.

    Yuji Yaginuma

  • Allow nil params for ActionController::TestCase.

    Ryo Nakamura

Active Job

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • No changes.

Railties

  • Seed database with inline ActiveJob job adapter.

    Gannon McGibbon

  • Fix boolean interaction in scaffold system tests.

    Gannon McGibbon

5.1.7

28 Mar 02:53
v5.1.7
4f66945
Compare
Choose a tag to compare

Active Support

  • No changes.

Active Model

  • No changes.

Active Record

  • Fix touch option to behave consistently with Persistence#touch method.

    Ryuta Kamizono

  • Back port Rails 5.2 reverse_order Arel SQL literal fix.

    Matt Jones, Brooke Kuhlmann

  • becomes should clear the mutation tracker which is created in after_initialize.

    Fixes #32867.

    Ryuta Kamizono

Action View

  • Fix issue with button_to's to_form_params

    button_to was throwing exception when invoked with params hash that
    contains symbol and string keys. The reason for the exception was that
    to_form_params was comparing the given symbol and string keys.

    The issue is fixed by turning all keys to strings inside
    to_form_params before comparing them.

    Georgi Georgiev

Action Pack

  • No changes.

Active Job

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Railties

  • No changes.