2018/04/03分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Extract the
confirm
call in its own, overridable method inrails_ujs
. - Disable
ActionView::Template
finalizers in test environment
Merge pull request #32404 from mathieumahe/master
actionview/app/assets/javascripts/rails-ujs/features/confirm.coffee
の修正です。
ユーザが独自のconfirm処理を使用出来るようにする為に、confirm dialogを表示する処理をfunction(Rails.confirm
)に切り出しています。
Merge pull request #32336 from vincedevendra/allow_mutating_dig_return_value
actionpack/lib/action_controller/metal/strong_parameters.rb
の修正です。
ActionController::Parameters#dig
の戻り値がActionController::Parameters
のインスタンスだった場合に、毎回新しいオブジェクトを生成していたのを、dig
を呼び出した自身を返すよう修正しています。
毎回新しいオブジェクトが生成されると、dig
の結果に直接値を指定する事ができない為、との事です。
# before params = ActionController::Parameters.new(a: { b: { c: 1 } }) params.dig(:a, :b)[:c] = 2 params # => <ActionController::Parameters {"a"=>{"b"=>{"c"=>1}}} permitted: false> params = ActionController::Parameters.new(a: { b: [1] }) params.dig(:a, :b)[0] = 2 params # => <ActionController::Parameters {"a"=>{"b"=>[1]}} permitted: false> # after params = ActionController::Parameters.new(a: { b: { c: 1 } }) params.dig(:a, :b)[:c] = 2 params # => <ActionController::Parameters {"a"=><ActionController::Parameters {"b"=><ActionController::Parameters {"c"=>2} permitted: false>} permitted: false>} permitted: false> params = ActionController::Parameters.new(a: { b: [1] }) params.dig(:a, :b)[0] = 2 params # => <ActionController::Parameters {"a"=><ActionController::Parameters {"b"=>[2]} permitted: false>} permitted: false>
Add action_view.finalize_compiled_template_methods
config option
Action Viewの修正です。
ActionView::Template
のfinalizerを実行するかどうかを指定するためのconfig(action_view.finalize_compiled_template_methods
)を追加しています。デフォルトはtest envではfalse(environments/test.rb
で指定)、他の環境ではtrueです。
Template::compile
メソッドでは、ObjectSpace#define_finalizer
を使用して、ActionView::CompiledTemplates
のオブジェクトが解放される際に定義されているメソッドを削除するようにしています。
これは頻繁にtemplateを更新するであろうdevelopment envでcompiled templatesがleakするのを防ぐ為らしいのですが、templateを更新しないtest envではこの処理はそもそも不要、かつ、templateが大量にある環境だとメソッドの削除処理のコストが高い為(テスト実行時間に影響があるレベルらしい)、finalizerを実行しないように出来るよう、configを追加したとの事です。
docの修正です。
各docのフォーマット、不要なスペースの削除等を行っています。
actionmailer/lib/action_mailer/test_helper.rb
のdocの修正です。
assert_enqueued_emails
メソッドのdoc内のexampleコードでクォートが不足している箇所があったのを修正しています。
Remove credits.html from Rails Guides
Rails guideからcreditsページを削除しています。
guideの初期の頃に携わって人達が記載されていたのですが、ページ自体が保守されていない、かつ、今はRails Contributorsがあるので、個別ページはいらないだろう、というような理由で削除されています。
Display db:drop description in ActiveRecord
activerecord/Rakefile
の修正です。
db:drop
taskにdescを追加しています。
Cleanup credits related code as it is removed now in PR #32429
guides/rails_guides/helpers.rb
、guides/rails_guides/kindle.rb
の修正です。
creditsページ作成に関する処理が残っていたのを削除しています。