2016/01/27分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
clear view path cache between tests
actionpack/test/controller/render_test.rb
の修正です。
テストの前処理で、view cacheを毎回クリアするよう修正しています。
Fix undefined error for ActionController::Parameters
actionpack/lib/abstract_controller/rendering.rb
の修正です。
AbstractController::Rendering
moduleを使用した場合に、ActionController::Parameters
が見つからない旨NameError
が発生してしまっていたのを修正しています。
_normalize_args
でActionController::Parameters
を使用していた為エラーになっていました。通常であれば普通に該当ファイルのrequire
追加して対応すると思うのですが、、AbstractController
でActionController
のファイルをrequieするのは不味いだろうという事で、引数のaction
がpermitted
メソッドを実装しているかどうか、という方法で修正を行っています。
- case action - when ActionController::Parameters - unless action.permitted? - raise ArgumentError, "render parameters are not permitted" - end + if action.respond_to?(:permitted?) && action.permitted? + raise ArgumentError, "render parameters are not permitted" action
actionview/test/template/text_helper_test.rb
の修正です。
rails-html-sanitizer
1.0.3で下位非互換な対応が入り、その影響で壊れてしまったテストがあったのを修正しています。
rail-html-sanitizer
でのsecurity fix対応の影響。
fix permitted? conditional for render
calls
actionpack/lib/abstract_controller/rendering.rb
の修正です。
先の_normalize_args
メソッドでの、permitted
のチェック処理を修正しています。
- if action.respond_to?(:permitted?) && action.permitted? - raise ArgumentError, "render parameters are not permitted" - action + if action.respond_to?(:permitted?) + if action.permitted? + action + else + raise ArgumentError, "render parameters are not permitted" + end
permitted?
が定義されている、かつ、permittedがされてない場合に、ArgumentErrorにする、が本来やりたかった事のもよう。
actionpack/test/controller/render_test.rb
の修正です。
permitted済みのファイルのパスを指定したパラメータをrender
に指定した場合のテストが、4-2-stableでは動作するのに、masterブランチでは動作しない為、一時的にskipメソッドで無効化しています。
INSERT INTO schema_migrations in 1 SQL
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
の修正です。
schema_migrations のinsert処理で、insert 1行毎にSQLを発行していたのを、multi-row-insertを使用するよう修正しています。
恐らく、古いSQLiteだとmulti-row-insertをサポートしてなかった為、multi-row-insertを使用していなかったのでは、という事です。因みに、SQLite 3.7.11からmulti-row-insertをサポートしています。
参考:SQLite Release 3.7.11 On 2012-03-20
actionpack/test/controller/render_test.rb
の修正です。
テスト内のコメントで、AC::Params
をAc:Params
にタイポしている箇所があったのを修正しています。
remove duplication section [ci skip]
rails guideのA Guide for Upgrading Ruby on Rails
の修正です。
Ruby 2.2.2+
セクションが複数あったので、片方削除しています。
Revert "Eliminate the EventMachine dependency"
Action CableでEventMacineを使用しないよう対応したコミット(Eliminate the EventMachine dependency by matthewd · Pull Request #23152 · rails/rails)をrevertしています。
Basecampで実際テストした所、disconnect処理でエラーになってしまった為、revertしたとの事です。
actionview/lib/action_view/helpers/tags/collection_helpers.rb
のdocの修正です。
ActionView::Helpers::Tags::CollectionHelpers::Builder#render_collection_for
メソッド内のコメントで、実際の挙動と異なる箇所があったのを修正しています。