なるようになるブログ

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

rails commit log流し読み(2015/08/29)

2015/08/29分のコミットです。

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


revises 877e42e

actionpack/lib/action_controller/metal/strong_parameters.rbactionpack/test/controller/required_params_test.rbの修正です。

ActionController::Parameter#requireメソッドの引数にArrayを指定出来るよう修正した、[Feature] params.require requires array of paramsのfollow upを行っています。

exampleにタイポがあったのを修正、requireメソッドで使用する値に誤りがあったのを修正、テスト名より適切な名前に修正、等をまとめて行っています。


Set the content-type to text/html if the options[:html] is true

actionpack/lib/abstract_controller/rendering.rb, actionpack/test/controller/new_base/render_html_test.rbの修正です。

renderメソッドのオプションに:htmlを指定した場合に、content typeにMime::HTMLを設定するよう修正しています、

元々は、オプションに:plainが指定された場合の挙動のみ記載されていたのですが、デフォルトで設定されるcontent typeが`Mime::TEXTの為、そちらの処理は不要との事で削除しています。


make ENV a required argument

railties/lib/rails/test_unit/minitest_plugin.rbの修正です。

rails testコマンドで、環境を指定する-eオプションの引数を必須にしています。

-    opts.on("-e", "--environment [ENV]",
+    opts.on("-e", "--environment ENV",

これにより、-eオプションが指定され、かつ引数の指定がない場合に、適切なエラークラスでraiseされるようになります。

# Before:
$ ./bin/rails t -e
rails/railties/lib/rails/test_unit/minitest_plugin.rb:21:in `block in plugin_rails_options': undefined method `strip' for nil:NilClass (NoMethodError)

# After:

$ ./bin/rails t -e
/rails/railties/lib/rails/test_unit/minitest_plugin.rb:29:in `plugin_rails_options': missing argument: -e (OptionParser::MissingArgument)

revamps the docs of strong params require [ci skip]

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

[Feature] params.require requires array of params の対応により、ActionController::Parameter#requireメソッドの引数にArrayを指定出来るようなったのに合わせて、requireメソッドのdocを全体的に修正しています。


swaps words [ci skip]

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

ActionController::Parameter#requireメソッドのdocにタイポがあったのを修正しています。


fixes example for consistency [ci skip]

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

ActionController::Parameter#requireメソッドのdocのexampleに使用するメソッド名を、doc内で同一のメソッドを使用するよう修正しています。