2021/11/26分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Ignore persisted in-memory records when merging target lists.
- Fix
ActiveRecord::QueryMethods#in_order_of
behavior for integer enums. #authenticate
returns 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を追加しています。