2021/12/04分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Add authenticate_by when using has_secure_password
Active Recordの修正です。
has_secure_password
を使用しているデータを取得する為のauthenticate_by
メソッドを追加しています。
User.authenticate_by(email: "jdoe@example.com", password: "abc123")
User.find_by(email: "...")&.authenticate("...")
と目的は同じなのですが、左記のコードだとセキュリティの懸念がある(入力されたemailで検索している、かつ、timing-based enumeration attacksをされた場合に、存在するemailかどうかを攻撃者が検知出来る可能性がある)為、セキュリティの懸念なくユーザの検索を出来るようにする為にメソッドを追加しています。
Fix flakey test in Active Record dirty_test.rb
activerecord/test/cases/dirty_test.rb
の修正です。
時間を比較しているテストが、実行タイミングによりランダムにfailしてしまっていたので、値を比較する際に1秒以内の誤差は許容するよう修正しています。
Document ActiveSupport::Testing::Deprecation
activesupport/lib/active_support/testing/deprecation.rb
の修正です。
ActiveSupport::Testing::Deprecation
の各メソッドにdocを追加しています。
Merge pull request #43591 from SkipKayhil/fix-actioncable-js-module
actioncable/package.json
の修正です。
Action CableのnpmパッケージでESM版のコードがデフォルトのmoduleとして参照されるよう修正しています。
Merge pull request #43766 from cryptoque/fix-regression-bug-form-for-polymorphic-path-options
actionview/lib/action_view/helpers/form_helper.rb
の修正です。
Implement form_for by delegating to form_withの対応の影響で、form_for / form_withで新規レコードを指定 + format
を指定しなかった場合の結果が変わってしまっていたのを、元の挙動になるよう修正しています。
Cleanup spaces in the CHANGELOG
activerecord/CHANGELOG.md
の修正です。
エントリーから不要なスペースを削除しています。
Flip blob question to allow us to exit early
activestorage/app/models/active_storage/blob.rb
の修正です。
compose
メソッドでblobs
がpersisted?
かどうかをチェックしていたのを、new_record?
かどうかをチェックするよう修正しちえます。
compose is primarily meant to take blobs so make them a positional argument
activestorage/app/models/active_storage/blob.rb
の修正です。
compose
メソッドのblobs
引数をpositional argumentに変更しています。
[ci skip] compose no longer returns the checksum, remove comment
activestorage/lib/active_storage/service.rb
のdocの修正です。
compose
メソッドのdocにcomposed fileのchecksumを返す旨説明があったのを削除しています。現在はchecksumを返すようにはなってない為。
Pass an array through our stack, don't bother converting back & forth
Active Storageの修正です。
compose
メソッドの第一引数に可変長引数を指定出来るようにしていたのた、出来ないよう修正しています。可変長引数を指定出来る必要性は無い為。
Clarify passwords/findesr difference by preemptive extraction
activerecord/lib/active_record/secure_password.rb
の修正です。
authenticate_by
メソッドでpasswords / findersを一度の処理で取得出来るようにして、attributes
に対するexcept
処理を削除出来るよう修正しています。