2021/11/26分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Ignore persisted in-memory records when merging target lists.
- Fix
ActiveRecord::QueryMethods#in_order_ofbehavior for integer enums. #authenticatereturns false when the password is blank instead of raising an error.- Load STI Models in fixtures
activestorage/CHANGELOG.md
Clarify Active Record Encryption docs
rails guideのActive Record Encryptionの修正です。
guide全体のグラマーや言い回しの修正を行っています。
Fix DescendantTracker.clear on Ruby 3.1
Active Support、railtiesの修正です。
ActiveSupport::DescendantsTracker.clearがRuby 3.1で動作しなくなっていた(Ruby本体のClass#descendantsを使うようにした影響)のを修正しています。
DescendantsTracker: fix the TruffleRuby branch
activesupport/lib/active_support/descendants_tracker.rbの修正です。
ActiveSupport::DescendantsTracker.clearのTruffleRuby向けの処理で必要なオブジェクトのインスタンス生成が漏れていたのを修正しています。
Make sure errors.messages works in the same way as Rails 6.1
activemodel/lib/active_model/errors.rbの修正です。
errors.messagesに存在しないattributeを指定した場合に空のArrayを返すよう修正しています。Rails 6.1までと同じ挙動になるようにする為。
Require the ErrorReporter#handle fallback to be a callable
activesupport/lib/active_support/error_reporter.rbの修正です。
Rails.error.handleに指定するfallback値に、callableを指定させるよう修正しています。
activerecord/lib/active_record/associations/collection_association.rbの修正です。
to_aメソッドなどでpersisted recordsとin-memory recordsのマージ処理が行われる場合に、実際に保存されているrecordよりも多く結果が変える(in-memory内にあるpersited recordsの考慮が不足していた)事があるバグがあったのを修正しています。
Merge pull request #43324 from ghiculescu/patch-5
activesupport/lib/active_support/core_ext/module/attribute_accessors.rb、
activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rbのdocの修正です。
thread_mattr_accessorや親/子クラスと値を共有しない点についてdocに説明を追加しています。
activerecord/lib/active_record/relation/query_methods.rbの修正です。
ActiveRecord::QueryMethods#in_order_ofにintegerのenumで定義した値を指定した場合に正しく結果が取得出来ないバグがあったのを修正しています。
Merge pull request #43284 from mibradev/password-digest-nil
activemodel/lib/active_model/secure_password.rbの修正です。
passwordが空の場合に#authenticateメソッドがerrorをraiseしていたのを、falseを返すよう修正しています。
Add CHANGELOG entry for #43284
activerecord/CHANGELOG.mdの修正です。
先の#authenticateメソッドの対応についてCHANGELOGにエントリーを追加しています。
Fix AzureStorageService#headers_for_direct_upload default for #43294
activestorage/lib/active_storage/service/azure_storage_service.rbの修正です。
AzureStorageService#headers_for_direct_uploadメソッドのcustom_metadata引数のデフォルト値の指定が不足していたのを修正しています。
railties/lib/rails/application/configuration.rbの修正です。
X-XSS-Protectionのデフォルト値をXSS auditorを無効(0)に変更しています。
X-XSS-Protectionヘッダーはdeprecateになっており、メジャーなブラウザ(Chromeなど)ではXSS auditorは既に削除済みの状態です。古いブラウザではX-XSS-ProtectionのデフォルトはXSS auditorを有効(1)になっている事があるのですが、これはsecurity issueになってしまう可能性がある為、明示的に無効を指定するようにしています(OWASP。
Use reflection_class in TableRow for fixtures
activerecord/lib/active_record/fixture_set/table_row.rbの修正です。
fixturesでmodelのロードをする際に、STIのsubclassについては正しいsubclassのmodelとしてロードするよう修正しています。これにより、STIのsubclassでenumを独自に定義していた場合に、fixture load時にそのenumの値が無視されてしまう、というバグがあったのが修正されるようになっています。
Merge pull request #43726 from timoschilling/add-pathname-existence
activesupport/lib/active_support/core_ext/pathname/existence.rbの修正です。
Pathname classに、ファイルが存在する場合はreceiverを、存在しない場合はnilを返すPathname#existenceを追加しています。これにより、ファイルが存在する場合のみファイルの中身を読み込みたいような場合に、Pathname.new("file").existence&.readのように書けるようになっています。
Add ActiveStorage::Blob.compose
Active Storageの修正です。
複数のblobを連結する為のActiveStorage::Blob.composeを追加しています。元々GCSにComposite objectsというファイルを結合する為の仕組みがあり、このAPIを使用してGCS serviceは実装されています。GCS以外のサービスについては、独自にファイルを結合してアップロードするようになっています。ActiveStorage::Blob.compose(filename: "all_numbers.txt", blobs: blobs)にように、結合後のファイル名と、結合したblobをArrayで指定する事で使用出来るようになっています。
Add missing require "active_support in XmlMini
activesupport/lib/active_support/xml_mini.rbの修正です。
不足していたactive_supportのrequireを追加しています。