なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2017/06/07)

2017/06/07分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activesupport/CHANGELOG.md


Tiny documentation fixes [ci skip]

actionpack/lib/action_dispatch/system_test_case.rbのdoc、及び、rails guideのA Guide to Testing Rails Applicationsの修正です。

ActionDispatch::SystemTestCaseのdoc及びguideのSystem Testingの項のグラマー、フォーマットの修正を行っています。


Remove invalid entry from the guides index page

guides/source/documents.yamlの修正です。

Remove obsolete Guides source files [ci skip] · rails/rails@1a5d939で削除されたProfiling Rails Applicationsがインデックスページに残っていたのを削除しています。


Update upgrading guide w.r.t. Parameters to use other example method than slice as this has actually been implemented by Parameters https://github.com/rails/rails/commit/f59559d70af237f8a52e4ebde34b39d834f2787e

rails guideのA Guide for Upgrading Ruby on Railsの修正です。

ActionController::Parameters No Longer Inherits from HashWithIndifferentAccess"の項で、permitted?に依存しないメソッドの例でsliceがあげられていたのですが、sliceActionController::Parametersに実装されており問題無い為、例のメソッドをmapに変更しています。


Cache: write_multi (#29366)

activesupport/lib/active_support/cache.rbの修正です。

ActiveSupport::Cache::Storewrite_multiメソッドを追加しています。名前の通りで複数データをまとめて書き込む為のメソッドです。

Rails.cache.write_multi foo: 'bar', baz: 'qux'

実際の書き込み処理はwrite_multi_entriesメソッドを使用するようになっており、fetch_multiでデータを書き込む場合(fetch出来なかった場合)もこちらのメソッドを使用するようになっています。write_multi_entriesの実装はwrite_entryを複数回呼び出すだけになっており、基本的には各storeクラスでオーバライドする事を想定しているとの事です(Redisの場合はMSETを使うようにする等)。