なるようになるブログ

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

rails commit log流し読み(2018/04/05)

2018/04/05分のコミットです。

CHANGELOGへの追加はありませんでした。


Remove superfluous ActionController::

actionpack/lib/action_controller/metal/exceptions.rbの修正です。

UrlGenerationErrorクラスの定義から不要なnamespace(ActionController::)の指定を削除しています。

UrlGenerationErrorクラスが定義されているのがmodule ActionController配下の為。


[ci skip] Add :private option to delegation doc

activesupport/lib/active_support/core_ext/module/delegation.rbのdocの修正です。

Module#delegateメソッドのdocにprivateオプションについての説明を追加しています。


Merge pull request #32447 from utilum/splat

actionview/lib/action_view/helpers/form_helper.rbactiverecord/lib/active_record/connection_adapters/abstract/schema_statements.rbの修正です。

Rubyのwarning(arning: passing splat keyword arguments as a single Hash toxx'`)が出ている箇所があったのを修正しています。

Ruby 2.6からHash オブジェクトをキーワード引数への展開として呼び出すとwarningが出るようになったようで、その為splat展開で引数を渡さないよう修正しています。

参考:vm_args.c: warn splat to var


Merge pull request #32446 from sinsoku/add_dig_to_session

actionpack/lib/action_dispatch/request/session.rbの修正です。

ActionDispatch::Request::Sessiondigメソッドを追加しています。名前の通り、Hash#digと同じ挙動です。

session[:user] = {'id': 1, 'avatar_url': 'http://example.org/nyancat.jpg'}
session.dig :user, :avatar_url #=> 'http//example.org/nyancat.jpg'

Merge pull request #32444 from matrinox/fix-return-response-mutation-rack-logger

railties/lib/rails/rack/logger.rbの修正です。

Rack::Logger#call_appメソッドでappが返すresponse body自身を変更してしまっていたのを、値毎に別の変数に保持するようにして、response bodyは直接変更しないよう修正しています。


Merge pull request #32441 from composerinteralia/refute-not

refute、及びrefute_xx系の assertionを使った場合に、assert_notを使用するよう指摘するcustom Copを追加しています。


Add :ujs desc to Rakefile in actionview

actionview/Rakefileの修正です。

test::ujs taskにdescを追加しています。


Use comment instead of desc in actionview's Rakefile

actionview/Rakefileの修正です。

integration test用のtaskに表示されないdescがあったのを削除し、descに記載されていた内容をコードのコメントとして記載するよう修正しています。