2017/11/07分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activemodel/CHANGELOG.md
Active Recordの修正です。
though assocationsのpreload処理のリファクタとして、不要なデータ構造やメソッドの削除、アルゴリズムの改善、等を行っています。
Resolve Minitest 6 deprecation in assert_no_changes
activesupport/lib/active_support/testing/assertions.rb
の修正です。
assert_no_changes
メソッドでbefore
がnilだった場合、assertionにassert_equal
ではなくassert_nil
を使用するよう修正しています。
Minitest 5.10からassert_equal
のexpected引数にnilを指定するのがdeprecateになった為。
Properly check transaction in persistence
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
の修正です。
TransactionManager#within_new_transaction
メソッドの後処理でcommit_transaction
メソッドを呼び出す際に、transaction
がnilじゃないかどうかチェックするよう修正しています。
Merge pull request #22435 from yui-knk/fix_engine_route_test
Action Packの修正です。
assert_recognizes
がmounted engineのpathを扱えないバグがあったのを修正しています。
Merge pull request #30101 from bogdanvlviv/initialization-active_storage
railtiesの修正です。
rails new
を実行時に、自動でActive Storageの初期化処理(active_storage:install
)を実行するよう修正しています。
合わせて、Active Storageをインストールしないようにする為の--skip-active-storage
オプションを追加しています。なお、Active StorageはActive Recordに依存している為、--skip-active-record
を指定した場合、自動でActive Storageもskipするようになっています。
Fix merge conflict and rubocop offences
actionpack/test/dispatch/routing_assertions_test.rb
の修正です。
merge conflictがそのままになっていたのを修正、及び、rubocopのルールに違反している箇所があったのを修正していまs.
Merge pull request #31058 from bogdanvlviv/ConfirmationValidator-with_false_value
activemodel/lib/active_model/validations/confirmation.rb
の修正です。
ConfirmationValidator
で_confirmation
にfalseが指定された場合、validationを実行するよう修正しています。
元は実行されていなかったのですが、ドキュメント、nilじゃない場合にvalidationを実行する、と説明が記載されており、それに合わせる為。微妙に非互換な感が。
Remove useless associated_records_by_owner
activerecord/lib/active_record/associations/preloader/association.rb
、
activerecord/lib/active_record/associations/preloader/through_association.rb
の修正です。
Association#associated_records_by_owner
、ThroughAssociation#associated_records_by_owner
メソッドを削除しています。
元々はassociated_records_by_owner
は、assocationsのsubclassでカスタマイズした結果を取得するように使われていました。
しかし、Refactored preloading of a though assocations以降、そのような使われ方はされなくなり、ただassociate_records_to_owner
メソッドを呼び出すだけになってしまっていたので、余計なメソッド呼び出しを減らす為に削除したようです。
Fix streaming downloads from S3/Azure Storage
activestorage/lib/active_storage/service/azure_storage_service.rb
、
activestorage/lib/active_storage/service/s3_service.rb
の修正です。
S3 / Azure storageを使用している場合に、streaming downloadが正しく動作しないバグがあったのを修正しています。
Merge pull request #30714 from bogdanvlviv/fix-rails_db_migrate_VERSION
Active Recordの修正です。
bin/rails db:migrate
に空のVERSION
を指定した場合、VERSION
を指定しない場合と同じ挙動になるよう修正、及び、VERSION
に不正なフォーマットの値を指定した場合に、適切なエラーメッセージ("Invalid format of target version: VERSION=xxx
")を表示するよう修正しています。
Merge pull request #31061 from bogdanvlviv/test-if-unless-options-for-validations
Active Modelのテストの修正です。
validation conditionsに複数の条件を指定した場合のテストを追加しています。
Merge pull request #30997 from q-centrix/nofollow-change
actionview/lib/action_view/helpers/url_helper.rb
の修正です。
UrlHelper#add_method_to_attributes
メソッドでrel
オプションが指定されていない場合に、不要なStringオブジェクトが生成されないようリファクタリングしています。
Fix comment in check_class_collision
[ci skip]
railties/lib/rails/generators/named_base.rb
の修正です。
check_class_collision
メソッド内のコメントでmodule名を誤っている箇所があったのを修正しています。
Remove needless block parameter
activestorage/lib/active_storage/service/s3_service.rb
の修正です。
Service::S3Service#stream
メソッドから不要なブロック引数を削除しています。