rails changelog


Welcome to the latest updates! Here’s a roundup of the latest changes, improvements, and fixes we've made to keep things running smoothly and efficiently. πŸš€

New Features & Improvements

  • Improved Documentation for Test Transactions with Multiple Databases: We've added comprehensive documentation to guide you through using test transactions when dealing with multiple databases. This includes examples and best practices to help you navigate multi-database environments with ease. πŸ“š

  • Rewind Code Optimization: The rewind code has been moved closer to the read_body_stream method in the raw_post method of action_dispatch/http/request.rb. This makes the code more efficient by only rewinding the body stream when necessary. Additionally, we've updated the rack gem version from 3.0.11 to 3.1.3 to keep things up-to-date. βš™οΈ

  • Correct Table Name in Migration Documentation: The table name in the schema for the add_reference migration has been corrected in the Active Record Migration Documentation. This ensures accuracy and clarity, helping you avoid any confusion or errors. πŸ“

  • Removed Outdated Migration Guide: The "Migrating from Classic to Zeitwerk" guide has been removed since Rails 7 apps now require running in zeitwerk mode. All necessary information is now covered in the "Autoloading and Reloading Constants" guide. πŸ—‘οΈ

Bugfixes

  • Fixed with_connection Offences in Active Record: We've tackled issues with the with_connection method within Active Record, ensuring it operates correctly and efficiently. This fix enhances the stability and performance of Active Record, making your database interactions smoother. πŸ› οΈ

  • Restored Original alias_attribute Behavior: The alias_attribute method now correctly ignores methods defined in parent classes, restoring the behavior that existed prior to a previous update. This fix aligns alias_attribute with regular attribute definitions, resolving the issue reported in issue #52144. πŸ”§

  • Fixed Nested Exception Backtraces on Ruby Master: Adjustments have been made to handle nested exception backtraces correctly in tests on Ruby master. This fix addresses issues reported in issue #16495 and issue #20275, ensuring reliable backtrace displays. πŸ›

Stay tuned for more updates and happy coding! πŸ’»βœ¨

Included Commits

2024-06-14T18:56:36 See commit

The commit moves the rewind code in the read_body_stream method inside the raw_post method in the action_dispatch/http/request.rb file. The reason for rewinding is because of the read_body_stream method being called, so the rewind code is moved closer to where it is needed. The changes involve reorganizing the code to only rewind the body stream if it responds to rewind, and handling different scenarios for reading the body stream based on the headers present.

In addition, the commit also updates the rack gem version in the Gemfile.lock file from 3.0.11 to 3.1.3. This change is part of the modifications made in the commit to improve the handling of rewinding in the context of calling the read_body_stream method.

Files changed

  • Gemfile.lock
  • actionpack/lib/action_dispatch/http/request.rb
2024-06-15T11:44:59 See commit

This commit adds documentation for test transactions with multiple databases. It explains how to use test transactions in code that interacts with multiple databases, providing clarity and guidance for developers working on such scenarios. The documentation likely includes examples and best practices for handling test transactions in a multi-database environment, helping to improve the understanding and implementation of this feature.

Overall, this commit enhances the documentation related to test transactions in scenarios involving multiple databases, aiming to make it easier for developers to write and test code that interacts with multiple databases. By providing clear instructions and examples, it helps to ensure that developers can effectively utilize test transactions in a multi-database setup, ultimately leading to more robust and reliable testing processes.

Files changed

2024-06-15T12:51:30 See commit

This commit addresses issues with the with_connection method within Active Record by making necessary fixes to offenses. The changes aim to improve the functionality and efficiency of the method, ensuring that it operates correctly within the Active Record framework. By resolving these issues, the commit contributes to the overall stability and performance of Active Record, enhancing its reliability for developers working with database connections.

The commit likely includes specific changes to the implementation of the with_connection method, such as correcting errors or optimizing its usage within Active Record. These adjustments may involve modifying code snippets, updating dependencies, or making other technical enhancements to ensure that the method functions as intended. Overall, the commit focuses on improving the functionality and reliability of with_connection within Active Record to provide a more seamless experience for developers interacting with database connections.

Files changed

2024-06-17T13:43:28 See commit

This commit addresses issues with nested exception backtraces in tests on Ruby master. It fixes the tests to properly handle nested exceptions, ensuring that backtraces are displayed correctly. The changes made in this commit likely address other issues as well, including those related to bugs reported on the Ruby issue tracker.

In addition to fixing the nested exception backtrace tests, this commit likely includes changes related to other reported issues on the Ruby issue tracker. The specific changes made are not detailed in the summary, but it can be inferred that they are related to improving the functionality and reliability of Ruby master based on the mentioned bug reports.

Files changed

2024-06-18T07:37:16 See commit

This commit fixes the issue with alias_attribute not ignoring methods defined in parent classes. Previously, when defining regular attributes, inherited methods were not overridden, but when defining aliased attributes, inherited methods were not considered. This behavior was present before a previous pull request, so this commit restores the original behavior.

The fix addresses the issue reported in https://github.com/rails/rails/issues/52144 and ensures that when using alias_attribute, methods defined in parent classes are ignored. This change aligns the behavior of alias_attribute with the behavior of regular attribute definitions in Rails.

Files changed

2024-06-19T13:23:14 See commit

This commit removes the "Migrating from Classic to Zeitwerk" guide as Rails 7 apps now require running in zeitwerk mode. The guide is no longer needed as the "Autoloading and Reloading Constants" guide covers autoloading with Zeitwerk, including autoload_paths, the zeitwerk:check command, and more. This streamlines the documentation and ensures that developers are directed to the appropriate resources for working with Zeitwerk in Rails 7 applications.

Files changed

2024-06-20T04:22:52 See commit

This commit corrects the table name in the schema for the add_reference migration in the Active Record Migration Documentation. It ensures that the correct table name is used when adding a reference in a migration, improving the accuracy and clarity of the documentation. This change will help developers accurately implement add_reference migrations in their projects and avoid confusion or errors related to table names.

Files changed