2023/04/26分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Make
.joins
/.left_outer_joins
work with CTEs. AbstractAdapter#execute
and#exec_query
now clear the query cache
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
CTE + .joins
/ .left_outer_joins
が動作するよう修正しています。
Post .with(commented_posts: Comment.select(:post_id).distinct) .joins(:commented_posts) #=> WITH (...) SELECT ... INNER JOIN commented_posts on posts.id = commented_posts.post_id
Merge pull request #46864 from palkan/feat/arel-function-tables
activerecord/lib/arel/table.rb
、
activerecord/lib/arel/visitors/to_sql.rb
の修正です。
computed/function tableをArelのtableとして扱えるよう修正しています。
Merge pull request #48034 from shivamsinghchahar/allow-symbols-as-queue-name-in-activejob-assertions
activejob/lib/active_job/test_helper.rb
の修正です。
test用のassertionメソッドでqueue nameにSymbolを指定出来るよう修正しています。
Merge pull request #48039 from ghiculescu/ar-encryption-default-proc
activerecord/lib/active_record/encryption/encryptable_record.rb
、
activerecord/lib/active_record/encryption/encrypted_attribute_type.rb
の修正です。
Active Record Encryptionを使用しているmodelのインスタンスをMarshal.dump
に指定した場合に、エラーになってしまうリグレッションが発生していたのを修正しています。
Fix Rack::Test::UploadedFile.new to work with StringIO
activestorage/lib/active_storage/attached/changes/create_one.rb
の修正です。
ActiveStorage::Attached::Changes::CreateOne#upload
に、StringIO
のインスタンスを使用しているRack::Test::UploadedFile
のインスタンスを指定した場合にエラーになってしまうバグがあったのを修正しています。
Merge pull request #47735 from nirebu/nirebu/stop-root-string-allocation-in-helper
actionpack/lib/action_dispatch/routing/redirection.rb
の修正です。
redirect処理でrelative pathかどうかをチェックする際に不要なオブジェクトを生成しないよう修正しています。
Rename uses_transactions
to materialize_transactions
Active Recordの修正です。
with_raw_connection
メソッドのuses_transactions
引数をmaterialize_transactions
にリネームしています。行っている処理的に、materialize_transactions
が適切な為。
Make Adapter#exec_query clear the query cache
Active Recordの修正です。
AbstractAdapter#execute
と#exec_query
でSQL実行後にquery cacheをclearするよう修正しています。元々はread only queryが使われる想定のAPIだった為query cacheをclearしてなかったのですが、実際はwrite queryが使われる事もあり、実行後にquery cacheが変更されない、というissueもきた為挙動が変更になりました。query cacheが変更にならないread only queryを実行したい場合、select
/ select_all
を使用すればよいようになっています。
Consistently raise an ArgumentError
if the ActiveSupport::Cache
key is blank
activesupport/lib/active_support/cache.rb
の修正です。
cacheのkeyにnil / blankを指定した場合の挙動がadapterによって異なっていたのを、全てのadapterでArgumentError
をraiseするよう修正しています。