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! 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 theIN
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 throughActiveRecord::Base.connection.select_all
. Your dates are in good hands! -
Add missing
ostruct
require tohttp_token_authentication_test.rb
: We added the missingostruct
require statement to ensure smooth testing. No more errors due to missing libraries! -
Arel: make
Or
nodes "Nary" likeAnd
: Fixed issue #51386 by restructuringOr
nodes to be "Nary" likeAnd
nodes. This reduces the depth of the tree for largeOR
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
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
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
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
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
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
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.