2022/07/05分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Improve working with PostgreSQL schemas
Active Recordの修正です。
PostgreSQLで明示的にschemaが指定されている場合に、create_join_table
等の一部のmigrationメソッドがschemaを考慮した動作になってなかったのを修正しています。
Merge pull request #45508 from malis/patch-3
actionview/app/assets/javascripts/rails-ujs/features/remote.coffee
の修正です。
HTTPメソッド名を取得するのにelement.method
を使用していたのを、getAttribute
を使用するよう修正しています。element.method
に明示的に値が指定されてしまっているような場合も、値を正しく取得出来るようにする為。
Merge pull request #37944 from vlado/with_cte
Active Recordの修正です。
common table expressionsを使用してActiveRecord::Relation
を取得するためのwith
メソッドを追加しています。
Post.with(posts_with_comments: Post.where("comments_count > ?", 0)) # => ActiveRecord::Relation # WITH posts_with_comments AS (SELECT * FROM posts WHERE (comments_count > 0)) SELECT * FROM posts Post.with(posts_with_tags: Post.where("tags_count > ?", 0)).joins("JOIN posts_with_tags ON posts_with_tags.id = posts.id") # => ActiveRecord::Relation # WITH posts_with_tags AS ( # SELECT * FROM posts WHERE (tags_count > 0) # ) # SELECT * FROM posts JOIN posts_with_tags ON posts_with_tags.id = posts.id
Fixed flaky test cases in 'test/cases/relation/merging_test.rb'.
activerecord/test/cases/relation/merging_test.rb
の修正です。
assertionで値を比較する際に、値をidでsortしてからチェックするよう修正しています。 sortを指定しないと結果が不定になる為。