We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
rails changelog
Hey there, coding wizards! 🌟 We've got a fresh batch of updates sprinkled with some magic dust to make your Rails experience even more enchanting. Dive in and see what's new, fixed, and improved just for you!
New Features & Improvements
-
Rails 8 Authentication Generator: Our documentation now sparkles with details about the new authentication generator feature in Rails 8. This magical tool creates models, controllers, views, routes, and migrations to simplify user authentication, including password resets! 🧙♂️✨
-
Block Support for
ActiveJob::ConfiguredJob#perform_later
: You can now pass a block to this method, giving you the power to execute custom code when your job runs. Flexibility level: expert! 🛠️ -
Nested Records Handling: Creating new records just got smarter! We've improved how nested through records are managed, ensuring your data relationships are as tight-knit as your favorite coding community. 🤝
-
Guide Version Navigation: Switching guide versions? No problem! We've added a feature to keep you on the same page (literally) when you hop between different versions of the guide. 📚🚀
-
Example for
AR.db_warnings_ignore
: We've added a practical example to help you master theAR.db_warnings_ignore
feature. Because who doesn't love a good example, right? 📝
Bugfixes
-
Thread-Safe Lazy Attribute Methods: We’ve squashed a pesky bug that caused thread safety issues with lazy attribute methods. Now, your multi-threaded adventures should be smoother than ever. 🐞🔨
-
Trix Editor Update: We've updated Trix to version 2.1.10 to keep your app secure from CVE-2024-53847. Because security is always in style! 🔒✨
-
PostgreSQL Test Fix: Our tests now play nice with PostgreSQL, fixing a notification count issue in
ActiveRecord::InstrumentationTest
. Your tests should now pass with flying colors! 🎨✅
Chores
- Homebrew Path Update: We've updated the Homebrew path to ensure your development environment runs as smoothly as a well-oiled machine. 🛠️✨
That's all for now, folks! Keep coding like the rockstars you are, and enjoy the new features and fixes. Until next time, happy hacking! 🎉👩💻👨💻
Included Commits
This commit enhances the ActiveJob::ConfiguredJob#perform_later
method by allowing it to accept a block. This addition enables developers to pass a block of code that can be executed when the job is performed, providing greater flexibility and customization in job execution. By supporting blocks, users can encapsulate specific logic or behaviors that should be executed alongside the job's primary tasks, improving the overall functionality and usability of the ActiveJob framework.
Overall, this change aims to streamline job management and execution within ActiveJob, making it easier for developers to tailor job behavior according to their specific needs without requiring additional modifications or workarounds.
Files changed
This commit resolves a failure in the ActiveRecord::InstrumentationTest#test_payload_connection_with_query_cache_enabled
specifically for the PostgreSQL adapter. The issue arose because the test was expecting two notifications for SQL queries, but an additional notification was triggered by the execution of the SHOW search_path
command, which is unique to the PostgreSQL adapter and not present in other database adapters. As a result, the test received three notifications instead of the expected two.
To fix this, the commit modifies the test code to filter the notifications captured during the execution of the Book.cache
block, ensuring that only the relevant SQL query notifications are counted. The updated logic selects notifications that match a SQL query pattern, allowing the test to correctly assert that two notifications were generated, thus aligning the actual behavior with the expected outcome. This change not only fixes the specific test failure but also enhances the accuracy of the notification counting mechanism in the context of PostgreSQL.
Files changed
- activerecord/test/cases/instrumentation_test.rb
The commit addresses the handling of nested through records when creating new records in the application. It ensures that the relationships between the primary records and their associated nested records are properly established during the creation process. This enhancement improves data integrity and consistency by allowing the application to manage complex associations more effectively.
Additionally, the changes likely include updates to the relevant models and methods to support this functionality, ensuring that any new records created can seamlessly incorporate nested relationships. Overall, this commit enhances the application's capability to manage hierarchical data structures, streamlining the record creation process.
Files changed
This commit introduces a feature that enhances the user experience by appending the path to the version URL when selecting a different version of the guide. This ensures that users remain on the "Active Record Basics" guide, even as they switch between various versions.
The changes implemented streamline navigation, allowing for a more consistent and intuitive experience when accessing different versions of the documentation. Overall, this update aims to improve usability and maintain context for users exploring the guides.
Files changed
This commit addresses a thread safety issue in the definition of lazy attribute methods within the Rails framework. The problem arose because the system could not reliably determine if attribute methods had been generated, particularly when multiple threads were involved, leading to potential race conditions. To resolve this, the commit mandates that the framework should always assume that the method may have been generated, thereby ensuring consistent behavior across threads.
The changes implemented in this commit are a direct response to the discussions and findings detailed in the linked GitHub issues and pull requests, specifically addressing issue #53667 and following up on pull request #50594. By enhancing the thread safety of lazy attribute method definitions, this update aims to improve the reliability and stability of the Rails framework in multi-threaded environments.
Files changed
This commit introduces an example demonstrating the use of the AR.db_warnings_ignore
feature. By providing a practical illustration, it aims to clarify how this functionality can be utilized within the codebase. The commit includes necessary adjustments to the documentation or code comments to enhance understanding for users looking to implement this feature in their own projects.
The addition of this example is intended to improve the user experience by making it easier for developers to grasp the context and application of AR.db_warnings_ignore
, ultimately aiding in better integration and usage of the ActiveRecord framework.
Files changed
This commit enhances the documentation for Rails 8 by detailing the newly introduced authentication generator feature. The updates are primarily made to the guides/source/security.md
file, where 206 lines of content have been added to explain how the authentication generator streamlines the process of implementing user authentication in Rails applications. The documentation outlines the functionality of the generator, which creates essential models, controllers, views, routes, and migrations to facilitate user authentication and password reset capabilities. It also emphasizes the importance of using the bcrypt
gem for secure password hashing and provides clear instructions on how to implement the generator, including running migrations and setting up user sign-in and password reset flows.
Moreover, the commit highlights specific implementation details, such as the use of has_secure_password
for password management and the SessionsController
for handling user sessions. It also includes practical examples of how to utilize the authentication features in Rails applications, encouraging developers to explore the source code for a deeper understanding. Overall, this documentation update aims to equip developers with the knowledge to effectively secure their applications through the built-in authentication functionalities provided by Rails 8.
Files changed
- guides/source/security.md
This commit updates the vendored version of the Trix editor to version 2.1.10 in response to security vulnerability CVE-2024-53847. The primary change involves modifying the trix.js
file located in the actiontext/app/assets/javascripts/
directory.
By updating to this newer version, the commit aims to address potential security risks associated with the previous version of Trix, ensuring that the application remains secure and up to date with the latest fixes and improvements.
Files changed
- actiontext/app/assets/javascripts/trix.js
The recent commit focuses on updating the Homebrew path within the project's configuration. This adjustment ensures that the system correctly references the latest version of Homebrew, which is essential for managing software packages effectively. By modifying the path, the commit aims to enhance compatibility and streamline the installation process for dependencies.
Overall, this change is crucial for maintaining an efficient development environment, allowing developers to access the most up-to-date packages and tools provided by Homebrew without encountering path-related issues.