rails changelog


Hey there! We've been busy making some awesome improvements and fixing bugs to make your experience even better. Check out the latest updates:


πŸš€ New Features

  • Allow IN with subselect to be preparable: You can now use the IN operator with subselects in a preparable manner. This means your queries can be prepared once and executed multiple times with different values, boosting performance and efficiency. Say goodbye to repetitive parsing and planning!

πŸ› οΈ Improvements

  • Documentation improvement for #fields_for: We've spruced up the documentation for the #fields_for method. Expect clearer explanations and more examples to help you use this method like a pro.

  • Update active_record_querying.md: The ActiveRecord querying documentation just got a major update! We've added more detailed explanations and examples to help you master querying in Ruby on Rails.

πŸ› Bugfixes

  • Add a Date decoder to the pg adapter to type cast dates: Fixed issue #51448 by adding a Date decoder to the pg adapter. Now, date columns will be correctly type cast to Ruby Date when running raw queries through ActiveRecord::Base.connection.select_all. Your dates are in good hands!

  • Add missing ostruct require to http_token_authentication_test.rb: We added the missing ostruct require statement to ensure smooth testing. No more errors due to missing libraries!

  • Arel: make Or nodes "Nary" like And: Fixed issue #51386 by restructuring Or nodes to be "Nary" like And nodes. This reduces the depth of the tree for large OR conditions, making it more efficient. Fun fact: this fix makes SQLite fail with "Expression tree is too large (maximum depth 1000)"β€”talk about a powerful improvement!


Stay tuned for more updates and keep rocking those queries! 🎸

Included Commits

2024-04-03T23:14:54 See commit

This commit adds a Date decoder to the pg adapter in order to type cast dates at the connection level. This means that columns of type date will now be type cast to ruby Date when running a raw query through ActiveRecord::Base.connection.select_all. This fix addresses issue #51448 and ensures that date columns are properly converted to the appropriate data type in Ruby.

Overall, this commit enhances the functionality of the pg adapter by improving the handling of dates and ensuring that they are correctly type casted when interacting with the database through ActiveRecord. This change helps to maintain data integrity and consistency when working with dates in Ruby applications.

Files changed

2024-04-04T12:47:53 See commit

This commit adds a missing ostruct require statement to the http_token_authentication_test.rb file. The ostruct library is needed for certain functionalities within the test file, and its absence was causing errors during testing. By including the require statement, the code now has access to the necessary ostruct functionality, allowing the tests to run smoothly without any issues.

Overall, this commit addresses a small but crucial oversight in the test file, ensuring that the ostruct library is properly loaded and available for use. This improvement enhances the reliability and effectiveness of the tests, contributing to a more robust testing environment for the codebase.

Files changed

2024-04-04T12:59:56 See commit

This commit in Arel makes Or nodes "Nary" like And, which reduces the depth of the tree for large OR conditions. The fix addresses an issue reported on GitHub that significantly decreases the depth of the tree, making it more efficient. Initially hesitant about the fix, the developer ultimately decided to implement it since And nodes are already structured in a similar way.

Interestingly, after implementing the fix, the reported repro script now causes SQLite to fail with the error message "SQLite3::SQLException: Expression tree is too large (maximum depth 1000)." This change improves the efficiency of large OR conditions in Arel and aligns the structure of Or nodes with And nodes.

Files changed

2024-04-05T04:20:10 See commit

This commit allows the use of the IN operator with subselects to be preparable. This means that the query can be prepared and executed multiple times with different values, improving performance by reducing the need to re-parse and plan the query each time it is executed. This change enhances the flexibility and efficiency of queries that use the IN operator with subselects, making it easier for developers to optimize their queries for better performance.

Files changed

2024-04-05T13:33:47 See commit

This commit involves documentation improvements for the #fields_for method. The changes made in this commit are aimed at enhancing the documentation for the #fields_for method, providing more clarity and guidance on how to use it effectively. The updated documentation includes additional details and examples to help users better understand the functionality and purpose of the #fields_for method.

Overall, this commit focuses on improving the documentation for the #fields_for method to make it more user-friendly and informative. By providing clearer explanations and examples, users will have a better understanding of how to utilize the #fields_for method in their code.

Files changed

2024-04-05T21:59:53 See commit

This commit updates the active_record_querying.md file. The changes made include updating the information related to querying in ActiveRecord. It provides more detailed explanations and examples of how to perform queries using ActiveRecord in Ruby on Rails. The commit aims to improve the understanding of querying in ActiveRecord for developers working with Ruby on Rails.

Overall, the commit enhances the documentation related to querying in ActiveRecord, making it more comprehensive and easier to follow for developers. It provides valuable insights into how to effectively use ActiveRecord for querying data in Ruby on Rails applications.

Files changed