rails changelog


Hey there, awesome developers! 🚀 We've got some exciting updates and fixes to share with you. Dive into the latest changes and enhancements that are sure to make your coding experience even more delightful. Here's what's new:

  • New feature: Add route helper connect for WebSockets 🌐
    Say hello to the new connect route helper, designed to make your WebSocket connections a breeze! This nifty addition streamlines the process, enhancing real-time communication and making your app even more dynamic and responsive. Get ready to supercharge your WebSocket interactions!

  • Improvement: Allow railties to use lazy routes 🛤️
    Railties just got a major upgrade! They can now seamlessly use lazy routes without any hiccups. By setting the route set class config earlier, we've ensured that your railties play nice with lazy loading, making route management smoother and more flexible.

  • New feature: Bulk insert fixtures on SQLite 🗄️
    Speed up your data loading with our new bulk insert feature for SQLite! This update allows multiple records to be inserted in one go, boosting performance and making your testing and development process faster and more efficient. Get ready for some serious time-saving!

  • Bugfix: Fix PostgresqlAdapter when prepared statements are disabled 🐛
    We've squashed a bug in the PostgreSQL adapter! The issue with handling prepared statements when they're disabled is now resolved. Plus, we've cleaned up the code by removing the without_prepared_statements? method, making your PostgreSQL experience smoother and more robust.

  • Improvement: Using signed_id for finding and setting session record 🔒
    Session management just got a security boost! By using signed_id for session records, we're ensuring that your session tokens are more secure and tamper-resistant. This update streamlines session handling and enhances the overall security of your application.

  • Improvement: Support minitest 5.25+ 🔧
    We've got you covered with the latest Minitest updates! Our code now supports Minitest 5.25+ and its new with_info_handler API, ensuring compatibility with the newest features while keeping support for all Minitest 5 versions. Testing just got even better!

  • Bugfix: Check invalid enum options for the new syntax 🚫
    No more sneaky invalid enum options! We've added a validation mechanism to catch those pesky _ prefixed options that are no longer valid in the new syntax. This update enforces the new rules and helps you avoid potential issues, keeping your code clean and error-free.

  • Bugfix: Fix create_table with :auto_increment option for MySQL adapter 🔄
    Creating tables with auto-incrementing fields is now a breeze! We've fixed the issue with the :auto_increment option in the MySQL adapter, allowing you to define primary keys that automatically increase in value without a hitch. Enjoy seamless database operations!

  • Chore: Update development_dependencies_install.md 📚
    We've spruced up the development_dependencies_install.md file! While the specifics aren't detailed, expect clearer instructions and possibly some new additions to make installing development dependencies easier and more intuitive. Happy coding!

That's all for now, folks! Keep building amazing things and stay tuned for more updates. 🎉

Included Commits

2024-08-09T15:56:19 See commit

This commit updates the authentication generator in Rails to enhance the handling of session records by utilizing signed_id for session management. Specifically, it modifies the migration for creating sessions by removing the token column and adjusts the session handling methods in the authentication concern to replace the use of a plain token with a signed version. This change improves security by ensuring that session tokens are signed, making them more resistant to tampering.

Additionally, the commit removes the has_secure_token method from the Session model, streamlining the session implementation. The updates include changes to how sessions are found and set, ensuring that the application uses Session.find_signed to retrieve sessions based on the signed token stored in cookies. Overall, these modifications contribute to a more secure and efficient session management system within the Rails framework.

Files changed

  • railties/lib/rails/generators/rails/authentication/authentication_generator.rb
  • railties/lib/rails/generators/rails/authentication/templates/controllers/concerns/authentication.rb
  • railties/lib/rails/generators/rails/authentication/templates/models/session.rb
2024-08-11T07:05:44 See commit

This commit introduces a feature for bulk inserting fixtures into an SQLite database. The primary enhancement allows for more efficient data loading by enabling multiple records to be inserted in a single operation, which can significantly improve performance compared to inserting records individually.

The changes likely involve modifications to the database interaction logic, ensuring that the new bulk insert functionality is seamlessly integrated with existing workflows. This update is expected to streamline the process of setting up test data or populating the database with initial records, ultimately enhancing the development and testing experience.

Files changed

2024-08-12T05:12:04 See commit

The commit updates the development_dependencies_install.md file, which likely provides instructions or guidelines for installing development dependencies in a project. While specific details about the changes are not provided, the update may include clarifications, corrections, or additions to the existing documentation to enhance clarity and usability for developers. This could involve updating installation commands, adding new dependencies, or improving the overall structure of the document to facilitate easier understanding and implementation.

Files changed

2024-08-12T15:57:57 See commit

This commit addresses an issue in the PostgreSQL adapter related to the handling of prepared statements when they are disabled. It resolves a specific problem highlighted in a discussion on GitHub, ensuring that the adapter functions correctly under these conditions. Additionally, the commit removes the without_prepared_statements? method, streamlining the code and enhancing maintainability.

Overall, these changes improve the robustness of the PostgreSQL adapter by ensuring it operates correctly without relying on prepared statements, while also simplifying the codebase by eliminating unnecessary methods.

Files changed

2024-08-12T20:52:22 See commit

This commit introduces a new route helper called connect specifically designed for WebSocket functionality. The addition aims to streamline the process of establishing WebSocket connections within the application, enhancing the overall user experience and enabling real-time communication features.

The implementation of the connect helper simplifies the setup of WebSocket routes, making it easier for developers to integrate and manage WebSocket connections in their projects. This change is expected to improve code readability and maintainability, while also providing a more efficient way to handle WebSocket interactions.

Files changed

2024-08-13T06:59:59 See commit

This commit introduces a significant improvement for railties by enabling them to utilize lazy routes more effectively. Previously, railtie initializers faced limitations when trying to access app.routes, as they were unable to properly reference the route_set_class setting, which required the use of a standard route set. This restriction hindered the integration of railties with lazy loading of routes.

With this update, the configuration for the route set class is now established earlier in the initialization process. As a result, railties can seamlessly interact with lazy routes without causing interference, enhancing the overall functionality and flexibility of route management within the application.

Files changed

2024-08-13T09:35:50 See commit

This commit addresses an issue with the create_table method in the MySQL adapter by ensuring proper handling of the :auto_increment option. The update enhances the functionality by allowing developers to specify the :auto_increment attribute when creating tables, which is essential for defining primary keys that automatically increment in value.

As a result of this fix, users can now seamlessly create tables with auto-incrementing fields, improving the overall usability and reliability of the MySQL adapter in managing database schemas. This change is expected to streamline database operations and reduce potential errors associated with manual value assignments for primary keys.

Files changed

2024-08-14T17:48:16 See commit

This commit introduces a validation mechanism to check for invalid enum options when using the new syntax in ActiveRecord. Specifically, options prefixed with an underscore, such as _prefix, _suffix, _scopes, _default, and _instance_methods, which were valid in the old syntax, are now deemed invalid. The code has been updated to raise an ArgumentError if any of these options are used, helping to enforce the new syntax rules and prevent potential issues.

In addition to the code changes, the commit includes several tests that verify the correct behavior of the validation. Each test checks that an appropriate error message is raised when an invalid option is specified, ensuring that developers are informed of the mistake. The commit resolves issue #52586, contributing to the overall robustness and clarity of the enum implementation in ActiveRecord.

Files changed

  • activerecord/lib/active_record/enum.rb
  • activerecord/test/cases/enum_test.rb
2024-08-14T22:39:50 See commit

This commit updates the codebase to support Minitest versions 5.25 and above by accommodating a new API for the with_info_handler method, which now accepts an additional argument. This enhancement ensures compatibility with the latest features introduced in Minitest while maintaining support for all versions of Minitest 5.

The changes made in this commit reflect a proactive approach to keeping the code up-to-date with the evolving Minitest framework, thereby enhancing its functionality and ensuring that users can leverage the improvements in newer versions without losing access to earlier functionality.

Files changed