We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
rails changelog
Here's a rundown of the latest and greatest updates:
### New feature
- **Define the new `start_transaction.active_record` event**: 🚀 A brand new event that gets triggered when a transaction is started in Active Record. This includes keys for both the transaction and connection objects. Tests are included to ensure it works correctly in various scenarios, and the Active Support Instrumentation guide has been updated to reflect this new event.
### Improvement
- **Restore some `config.secret_key_base` functionality**: 🌟 We've brought back some crucial functionality that was accidentally removed. Now, `Rails.application.secret_key_base` always delegates to `config.secret_key_base`, and manually set values are validated. Plus, the `generate_local_secret` process is simplified for better clarity and efficiency.
- **Improve documentation of `RecordNotSaved` and `RecordNotDestroyed`**: 📚 Added examples and explanations for better understanding. Now you'll know that `RecordNotDestroyed` is triggered by throwing `:abort` in callbacks, thanks to the co-author Carlos Antonio da Silva.
- **Bring back `puma.rb` to the target of `app:update`**: 🔄 To make sure you don't miss out on any improvements, `puma.rb` is back in the `app:update` process. This ensures you stay updated with the latest enhancements while still allowing for custom updates.
### Bugfix
- **Correct typo for Active Record Callbacks doc**: ✏️ Fixed a typo to keep our documentation top-notch.
- **Fix a value for disabling `enqueue_after_transaction_commit`**: 🔧 Corrected the value type to ensure the method functions as intended. Now it expects Symbol values, not Boolean.
- **Pin `sprockets-rails` version to 3.4.2 or lower**: 📌 Due to issues with version 3.5.0, we've pinned `sprockets-rails` to 3.4.2 or lower to maintain stability until the problem is fixed.
### Chore
- **Mark TimeZone TZInfo quacking methods as :nodoc:**: 📝 These methods are now hidden from the documentation, keeping things clean and focused on the supported methods.
Stay tuned for more updates, and happy coding! 🎉
Included Commits
This commit updates the Gemfile and Gemfile.lock to pin the sprockets-rails
gem version to 3.4.2 or lower. This change is made in response to an issue with version 3.5.0 of sprockets-rails
, which is causing problems that need to be addressed. The commit includes the specific version constraint for sprockets-rails
in the Gemfile and Gemfile.lock to ensure that the project uses a compatible version until the issue is resolved.
By specifying the version of sprockets-rails
as ">= 2.0.0", "< 3.5.0"
, the commit ensures that the project uses a version of the gem that is compatible with the current setup. This change is necessary to avoid any issues that may arise from using version 3.5.0 until the problem is fixed. The commit provides a temporary solution to maintain the stability and functionality of the project while waiting for a resolution to the issue with sprockets-rails
version 3.5.0.
Files changed
- Gemfile
- Gemfile.lock
This commit improves the documentation for RecordNotSaved and RecordNotDestroyed by adding examples and explaining that RecordNotDestroyed is triggered by throwing :abort in callbacks. The co-author of this commit is Carlos Antonio da Silva.
Overall, this commit enhances the clarity and understanding of these two exceptions in the Ruby on Rails framework. By providing more detailed explanations and examples, developers can better grasp when and how these exceptions are raised, ultimately improving their ability to troubleshoot and debug issues related to saving and destroying records in their applications.
Files changed
This commit marks the TimeZone TZInfo quacking methods as :nodoc:, indicating that they should not be documented. This means that these methods will not be included in the documentation for the TimeZone TZInfo class. This change likely reflects the decision to hide or exclude these methods from public documentation for clarity or to prevent confusion for users of the class. By marking these methods as :nodoc:, they are effectively hidden from view in the documentation, allowing users to focus on the documented and supported methods within the TimeZone TZInfo class.
Files changed
This commit restores functionality related to config.secret_key_base that was inadvertently removed during the deprecated secrets removal process. The original implementation prioritized the value of config.secret_key_base over other sources in all environments, updating it to a fallback value if unset. However, the new implementation only sets config.secret_key_base to a fallback value in the local environment and ignores it in production. This commit aims to restore the missing functionality by ensuring that Rails.application.secret_key_base always delegates to config.secret_key_base, simplifying the implementation and validating manually set values for config.secret_key_base.
Additionally, the commit simplifies the generate_local_secret process by separating file manipulation, setting config.secret_key_base, and returning a value into distinct steps. This ensures that the file is only created if necessary and the value stored in it is returned. Overall, the new implementation not only restores missing functionality related to config.secret_key_base but also improves validation for manually set values, which were previously only validated for fallback values.
Files changed
This commit fixes an issue where the enqueue_after_transaction_commit
method was expecting Symbol values instead of Boolean values. The commit sets a specific value for disabling the method, ensuring that it functions correctly. The link provided in the commit shows the specific lines of code that were updated.
Overall, this commit addresses a bug related to the enqueue_after_transaction_commit
method in Rails. By specifying the correct value type for the method, the issue is resolved and the method can now be used as intended. The changes made in the commit ensure that the method works properly and does not encounter any errors related to incorrect value types.
Files changed
This commit defines a new event called start_transaction.active_record
that is emitted when a transaction is started in Active Record. The event includes keys for the transaction object and connection object. The commit also includes tests to ensure that the event is triggered correctly when transactions are materialized and nested, as well as when requires_new: true
is used. Additionally, the commit updates the Active Support Instrumentation guide to include information about the new event and how transactions are handled in Active Record.
Overall, this commit introduces a new event to track when transactions are started in Active Record and includes tests to verify its functionality in different scenarios. The updates to the Active Support Instrumentation guide provide information on how transactions are handled and when the event is triggered, helping developers understand the behavior of transactions in Active Record.
Files changed
- activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
- activerecord/test/cases/transaction_instrumentation_test.rb
- guides/source/active_support_instrumentation.md
This commit brings back the puma.rb
file to the target of app:update
. This is a partial revert of a previous commit. The puma.rb
file may be updated by users, but Rails has made improvements to it in the past, such as in commits 06d614ada9e4609ff83659e842f48af3232a03a5 and f719787c582839fd2fcd886d70b43da3ddad2ceb. To ensure that users are aware of these improvements, the puma.rb
file should be updated during the app:update
process.
This change allows users to benefit from the improvements made to the puma.rb
file by Rails, while still allowing them to make their own updates as needed. By including the puma.rb
file in the app:update
process, users can easily stay up-to-date with any enhancements or changes that have been made to it by Rails.
Files changed
This commit corrects a typo in the Active Record Callbacks documentation. The typo was identified and fixed to ensure accuracy in the documentation. The commit message includes [ci skip] to indicate that this commit does not require a continuous integration build to be triggered. Overall, this commit simply makes a minor correction to improve the quality and accuracy of the Active Record Callbacks documentation.