なるようになるブログ

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

rails commit log流し読み(2016/03/31)

2016/03/31分のコミットです。

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

actioncable/CHANGELOG.md


Suppress warnings

actionmailer/test/i18n_with_controller_test.rbactionmailer/test/url_test.rbの修正です。

Deprecate :controller and :action path parametersで、routes.rbのpath parametersに:controller:actionを使用するのがdeprecateになたのですが、Action Mailerのテストで使用している箇所があり、不要なwarningが出ないようActiveSupport::Deprecation.silenceで処理を囲むよう修正しています。


Update Gemfile.lock

Gemfile.lockの修正です。

Run latest precompiled JRuby on CI only against ActionPack · rails/rails@3027970で使用するrake gemのバージョンを11.1修正したのですが、その際にGemfile.lockの更新が漏れてしまっていた(ファイルの一部分が更新されてかった)為、最新の内容にGemfile.lockを修正しています。


Replace meth with method to remove ambiguity

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

set_callbackメソッドのdoc内のexampleでmethodmethと略していたのを、略さずmethodと記載するよう修正しています。


Move @quoted_{column|table}_names cache up to the abstract adapter

Active Recordの修正です。

全adapter共通で使用する@quoted_column_names@quoted_table_namesについて、AbstractAdapterクラスで変数を保持するよう修正しています。


Cable: reconcile default worker pool size with low db conn pool size

actioncable/lib/action_cable/server/configuration.rbの修正です。

defaultのworker pool sizeをDBのconnection poolの値より小さい値になるよう修正しています。具体的には、デフォルトの値が100になっていたのを、4にしています。


Cable message encoding

Action Cableの修正です。

server側とclient(WebSocket)側とでメッセージのやりとりをする際、ActiveSupport::JSONを使用してメッセージのencode / decode処理を行っていたのを、ActiveSupport::JSONではなく任意のオブジェクトを指定出来るよう修正しています。指定するオブジェクトは#encode#decodeメソッドが実装されている必要があります。

code処理を行うオブジェクトはstream_forメソッドの引数に指定出来ます。

stream_for @room, coder: ActiveSupport::JSON do |message|
  # `message` is a Ruby hash here instead of a JSON string