rails changelog


Here's a delightful rundown of the latest changes and improvements:

  • New feature: ๐ŸŽ‰ ShardSelector now supports granular database connection switching! This means you can now switch databases with laser-like precision using a specific abstract connection class, rather than just globally. Plus, we've spruced up the Multiple Databases guide and ShardSelector documentation to help you navigate these new waters with ease.

  • Improvement: ๐Ÿ› ๏ธ We've made add_unique_constraint, add_check_constraint, and add_foreign_key revertible, even when given invalid options. This makes your database migrations smoother and more reliable. Big shoutout to Aidan Haran for the collaboration on this one!

  • Improvement: ๐Ÿ“‚ Load your SQLite3 extensions like a pro with config/database.yml! Thanks to the latest sqlite3 gem, you can now specify extensions with paths or module names. We've got you covered with updated documentation to guide you through this nifty feature.

  • Bugfix: ๐Ÿ“š Corrected the sample code in the strong parameter API docs to reflect its intended functionality. Now, developers can trust the examples to guide them right!

  • Bugfix: ๐Ÿ› Set framework_defaults in Active Job and Action Mailer bug report templates. This ensures your bug testing scripts run like a well-oiled machine, just like a regular Rails app.

  • Bugfix: ๐Ÿ”ง Fixed compatibility issues with the alphanumeric method parameters in SecureRandom for Ruby 3.2. We've added conditional checks to keep things running smoothly across different Ruby versions.

  • Chore: ๐Ÿงน Cleaned up RuboCop offenses in the codebase for better readability and style consistency. Your code is now as fresh and clean as a whistle!

Enjoy these updates and keep building amazing things! ๐Ÿš€

Included Commits

2024-12-01T17:10:45 See commit

This commit addresses an issue with the functions add_unique_constraint, add_check_constraint, and add_foreign_key in the codebase, ensuring that these operations can be reverted even when invalid options are provided. Previously, invoking these functions with incorrect parameters could lead to complications that made it challenging to roll back changes, potentially affecting database integrity and migration processes.

The update enhances the robustness of these functions by implementing better error handling and rollback mechanisms, thereby improving the overall reliability of database schema modifications. The commit is co-authored by Aidan Haran, indicating collaboration on this improvement.

Files changed

2024-12-02T23:38:28 See commit

This commit addresses compatibility issues with the alphanumeric method parameters in the SecureRandom module following the removal of Random::Formatter in Ruby 3.2. The chars parameter for the alphanumeric method is not available in this version, which necessitated conditional checks to ensure the base58 and base36 methods function correctly. The implementation includes a check for the number of parameters of the alphanumeric method, allowing for two different method definitions depending on the version of Ruby being used.

If the alphanumeric method accepts two parameters, the methods base58 and base36 will utilize it with the respective base alphabets. Conversely, if it only accepts one parameter, the methods will fall back on an alternate implementation that generates random bytes and maps them to the appropriate base alphabet. This change ensures that the SecureRandom module remains functional across different Ruby versions until Ruby 3.3 is adopted as the minimum supported version.

Files changed

  • activesupport/lib/active_support/core_ext/securerandom.rb
2024-12-04T16:41:06 See commit

This commit enhances the sqlite3 gem by introducing support for loading SQLite3 extensions through the config/database.yml configuration file, a feature made possible by version 2.4.0 of the gem. It allows users to specify extensions using either filesystem paths or module names that respond to the .to_path method, thereby improving flexibility in database configuration.

Additionally, the commit updates the documentation for the SQLite3Adapter, including detailed explanations in the RDoc and the "Configuring" guide, ensuring that users have clear guidance on how to utilize this new feature effectively. This improvement aims to streamline the process of configuring SQLite3 extensions within applications. For further details, refer to sparklemotion/sqlite3-ruby#586.

Files changed

2024-12-04T18:19:42 See commit

This commit updates the bug report templates for Active Job and Action Mailer by setting the framework_defaults. It serves as a follow-up to a previous commit that had overlooked these specific templates. By ensuring that the correct framework defaults are enabled, the commit aims to enhance the testing process for bugs, allowing the scripts to function more like those in a standard Rails application and facilitating the testing of older defaults.

Overall, this change contributes to a more consistent and reliable testing environment for developers working with bug reports in Active Job and Action Mailer, aligning the templates with the expected behavior of a typical Rails setup.

Files changed

2024-11-29T01:38:33 See commit

The commit addresses an issue in the sample code provided in the strong parameter API documentation. It corrects the output of the example to ensure it accurately reflects the intended functionality of the strong parameters feature.

By making these adjustments, the documentation becomes clearer and more reliable for developers who rely on it for guidance in implementing strong parameters within their applications. This change enhances the overall quality and usability of the documentation.

Files changed

2024-11-29T17:42:10 See commit

The recent commit introduces enhancements to the ShardSelector, enabling it to facilitate granular database connection switching based on a specific abstract connection class, rather than relying solely on the global switching mechanism provided by ActiveRecord::Base. This improvement allows for more precise control over database connections, catering to specific use cases and enhancing overall flexibility in managing database interactions.

In addition to the core functionality updates, the commit also includes revisions to the Multiple Databases guide and improvements to the ShardSelector documentation, ensuring that users have access to clear and comprehensive information on utilizing these new features effectively.

Files changed

2024-11-30T15:16:29 See commit

The commit addresses and resolves various RuboCop offenses within the codebase. RuboCop is a static code analyzer for Ruby, which helps maintain code quality and adherence to style guidelines. The changes made in this commit include modifications to the code that align it with the recommended practices, ensuring better readability and maintainability.

By fixing these offenses, the commit enhances the overall quality of the code, making it more compliant with established Ruby conventions. This not only improves the codebase's integrity but also facilitates smoother collaboration among developers by reducing potential conflicts arising from style discrepancies.

Files changed