2019/07/16分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activesupport/lib/active_support/cache.rbの修正です。
一箇所でしか使用されていないlogメソッドを削除し、使用している箇所で直接処理を行うよう修正しています。
Merge pull request #36532 from itsWill/add_to_a_to_annotated_source_code
actionview/lib/action_view/template/error.rbの修正です。
Template::Error#source_extractメソッドがバックトレースからファイル名を見つけられなかった場合に空の配列を返すよう修正しています。
元々は上記のケースではnilが返っていたのですが、source_extractを使用しているメソッドはArrayが来ることを期待しており、nilが来るとエラーになってしまう為。
Remove caveat for older Ruby's dup behavior [ci skip]
rails guideのActive Support Core Extensionsの修正です。
duplicable?の項にあった古いRubyでの挙動についての説明を削除しています。
Merge pull request #36640 from Edouard-chin/ec-uniq-validation-fix
activemodel/lib/active_model/error.rbの修正です。
ActiveModel::Errorで同じエラーかどうかをチェックする際に、callback optionは無視してチェックするよう修正しています。
Merge pull request #36649 from Edouard-chin/ec-errors-strit-match-collection
activemodel/lib/active_model/error.rbの修正です。
ActiveModel::Error#strict_match?メソッドで実際にエラーメッセージを生成して一致するかチェックしていたのを、オプションの値で一致するかどうかをチェックするよう修正しています。
attributeにassocation名 + attributeのフォーマットで指定された場合(e.g. :"family_members.name")に正しくエラーメッセージの生成が出来ない為。
Merge pull request #36654 from Edouard-chin/ec-errors-delete
activemodel/lib/active_model/errors.rbの修正です。
ActiveModel::Errors#deleteメソッドが、何も削除しなかった場合はnilを返すよう修正しています。
active_support/core_ext/object/duplicable is not in use here
activerecord/lib/active_record/base.rb、
activesupport/lib/active_support/cache/strategy/local_cache.rbの修正です。
使用していないactive_support/core_ext/object/duplicableのrequireを削除しています。
Merge pull request #36656 from Edouard-chin/ec-local-cache-reference
activesupport/lib/active_support/cache/strategy/local_cache.rbの修正です。
fetch_entryメソッドでlocal cacheから値を返す時に、値の参照が返っていたのを、値のコピーを返すよう修正しています。誤って元の値を変更してしまうのを避ける為。
Merge pull request #36676 from wjessop/change_activestorage_metadata_duration_to_bound
activestorage/test/analyzer/video_analyzer_test.rbの修正です。
Fix activestorage CI failure due to ffprove version differeceでOSのバージョンが変わった事により影響があったdurationのチェックを削除したのですが、その他影響が無かったdurationのチェックはそのままになっていました。
で、このPRではそのままになっていた(修正する必要が無い)durationのチェック処理を、値を厳密にチェックするのではなく、特定の範囲内に収まっているかチェックするようにしています。
Merge pull request #36672 from jbaranov/strong-params-hash
actionpack/lib/action_controller/metal/strong_parameters.rbの修正です。
ActionController::Parameters#hashメソッドを追加しています。値は@parametersのhashと@permittedを入れたArrayの`hash。
Array#uniqやSetを使用した場合に、正しく重複データが削除されるようにする為。
params1 = ActionController::Parameters.new(a: 1) params2 = ActionController::Parameters.new(a: 1) [params1, params2].uniq # => [<ActionController::Parameters {"a"=>1} permitted: false> set = Set.new() set.add(params1) set.add(params2) set # => #<Set: {<ActionController::Parameters {"a"=>1} permitted: false>}>
Merge pull request #36557 from sikachu/fix-source-annotation-extractor-annotation
activesupport/lib/active_support/deprecation/proxy_wrappers.rbの修正です。
ActiveSupport::Deprecation::DeprecatedConstantProxyでdeprecateにしたクラスのサブクラスにアクセス出来ない(e.g. SourceAnnotationExtractorをdeprecateにした場合、SourceAnnotationExtractor::Annotation)という問題があったのを、通常のクラス同様サブクラスにアクセス出来るよう修正しています。
Fix Loadable.exclude_from to also reset Kernel#require
activesupport/lib/active_support/dependencies.rbの修正です。
Loadable.exclude_fromで、Kernel#load同様にKernel#requireの呼び出し処理のリセットを行うよう修正しています。不要なメソッド呼び出しを減らせるようにする為。
Merge pull request #31634 from afcapel/reduce-routing-error-log-noise
actionpack/lib/action_dispatch/middleware/debug_exceptions.rb、
actionpack/lib/action_dispatch/middleware/exception_wrapper.rbの修正です。
ActionController::RoutingErrorが発生した際にバックトレースが全て表示されていたのを、アプリ部分のトレースだけ表示するよう修正しています。
今までだとバックトレースが数十行になってしまっていたのですが、ActionController::RoutingErrorsが発生した場合、ライブラリのトレースは不要な事が殆ど(必要なのはトレースではなくパスの情報だけ)必要無い為。
Make the selent exceptions configurable on the exception wrapper
actionpack/lib/action_dispatch/middleware/exception_wrapper.rbの修正です。
バックトレースの表示を、アプリのトレースだけに制限するエラーをconfig(silent_exceptions)で管理するよう修正しています。
Reuse the exception class name in all places in the wrapper
actionpack/lib/action_dispatch/middleware/exception_wrapper.rbの修正です。
各箇所で使用しているexception class nameを変数で保持するよう修正しています。
Merge pull request #36639 from Edouard-chin/ec-am-errors-fullmessages
Active Modelの修正です。
ActiveModel::Errors#full_messageメソッドをActiveModel::Errorクラスに移動しています。
元々の実装だとActiveModel::Errorsのコンストラクタに渡すbaseオブジェクトに定義されている必要があったのですが、これはRails 6.0までは不要な制限だった、かつ、そもそもメソッドの呼び出し的にErrorsにメソッドが定義されている必要が無かった為、Errorに移動するようにしています。