なるようになるブログ

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

rails commit log流し読み(2017/03/23)

2017/03/23分のコミットです。

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

activesupport/CHANGELOG.md


Stop complaining about not being able to digest dynamic template partial names and simplify error logging to a single line when not

actionview/lib/action_view/digestor.rbの修正です。

templateのdigestを作成する際に、テンプレートが見つからなかった場合その旨ログを出力するようになっていたのですが、動的にpartial templateをrenderする際は追跡が出来ないので、ログを出力しないよう修正しています


Skip isolated test runs on older rubies

ci/travis.rbの修正です。

古いRuby(2.4未満)ではisolated testを実行しないよう修正しています。


Suppress WARNING: nonstandard use of \\ in a string literal warning

activerecord/test/cases/adapters/postgresql/bytea_test.rbの修正です。

bytea型についてのテストでescape_string_warningをoffにするよう修正しています。string literalについてのwarning(WARNING: nonstandard use of \\ in a string literal)が出ており、それを抑止するためとの事です。


Fix a race in ActionCable stream tests

actioncable/test/channel/stream_test.rbの修正です。

streamingのテストでsubscriptionの処理の後にwaitするよう修正しています。connection.pubsubを二重にスタブしている為、最初の処理を終わるってから処理を行う必要がある為。


Small grammar fix

actionpack/lib/action_dispatch/http/mime_negotiation.rbのdocの修正です。

ActionDispatch::Http::MimeNegotiation#negotiate_mimeメソッドのdocのグラマーの修正を行っています。


Small grammar fix

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

ActionController::MimeResponds moduleのdoc内のグラマーの修正を行っています。


Merge pull request #28530 from kamipo/fix_ci_failure

actionview/test/template/digestor_test.rbの修正です。

Stop complaining about not being able to digest dynamic template partial names and simplify error logging to a single line when notの対応の際に、テストの修正が漏れていたので、修正内容と合わせてテストも修正しています。


Merge pull request #28524 from claudiob/comment-api-key

railties/lib/rails/generators/rails/app/templates/config/secrets.ymlの修正です。

デフォルトで生成されるsecrets.ymlに必ずapi_keyというconfigが追加されてしまっていたので、余計なconfigが追加されないよう、コメントアウトしています。


Merge pull request #28526 from kamipo/fix_log_subscriber_to_allow_legacy_binds

activerecord/lib/active_record/connection_adapters/abstract/quoting.rbactiverecord/lib/active_record/log_subscriber.rbの修正です。

LogSubscriberで古いフォーマットのbinds(多重配列の値。e.g. [[nil, 0]])も正しく出力出来るよう修正しています。


Merge pull request #28513 from maclover7/jm-fix-28500

railties/lib/rails/commands/server/server_command.rbの修正です。

rails server-bオプションとENV['HOST']を両方指定した場合に、-bオプションに指定された値が有効化されるよう修正しています。 Rails 5.0までの挙動と合わせる為。


Merge pull request #28527 from rst/fix_runner_argv_28515

railties/lib/rails/commands/runner/runner_command.rbの修正です。

rails runnerで指定したスクリプトARGVを参照した場合に、引数に指定した値が使用出来ないバグがあったのを修正しています。


Merge pull request #28528 from domcleal/parseerror-const-deprecation

Active Supportの修正です。

constをdeprecateする為のActiveSupport::Deprecation::DeprecatedConstantAccessor moduleを追加しています。

元々ActiveSupport::Deprecation::DeprecatedConstantProxyという同じようにconstをdeprecateにする為のクラスがあるのですが、こいつを使ってdepcateにした定数をrescueしようとするとエラーになる、という問題があり、Exceptionクラスをdeprecateする際に問題になっていた為、deprecateにしたconstをrescueにも使用出来るDeprecatedConstantAccessorを追加しています。実装はconst_missingで頑張ってる。


No need to have an entry that was included in 5.1 in 5.2

activesupport/CHANGELOG.mdの修正です。

先のコミットで追加されたActiveSupport::Deprecation::DeprecatedConstantAccessorについてのエントリーを削除しています。Rails 5.1にバックポートされており、5.2としての変更では無い為。


Document AC::Connection::Authorization#reject_unauthorized_connection

actioncable/lib/action_cable/connection/authorization.rbのdocの修正です。

Authorization#reject_unauthorized_connectionメソッドをpublic APIに変更しています。

各doc内のAction Cableのeampleコードで既に使用している為。


Merge pull request #28534 from claudiob/list-webpackers

railties/lib/rails/generators/app_base.rbの修正です。

rails newのhelpで、webpackオプションに指定可能な値(現時点では、react/vue/angular)を表示するよう修正しています。


Merge pull request #28540 from kamipo/remove_collection_proxy_uniq

activerecord/lib/active_record/associations/collection_proxy.rbの修正です。

CollectionProxy#uniqメソッドを削除しています。Delegate `uniq` to `records`uniqrecordsdelegateするようになった為。


Move comment to inside the method [ci skip]

activerecord/lib/active_record/connection_adapters/postgresql_adapter.rbのdocの修正です。

PostgreSQLAdapter#supports_ranges?メソッドの定義前にあったコメントをメソッドの中に移動しています。メソッド自体のdocでは無く、処理に対するコメントだった為。


Fix duplicable? for Ratiional and Complex on ruby master, since they are now duplicable

activesupport/lib/active_support/core_ext/object/duplicable.rbの修正です。

Ratiional、ComplexがRubyのtrunkではdup出来るようになった為、Ruby 2.5ではComplex#duplicable?Rational#duplicable?メソッドがtrueを返すよう修正しています。