なるようになるブログ

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

rails commit log流し読み(2017/10/05)

2017/10/05分のコミットです。

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


Extract repeatedly appeared prepending compatible table definition

activerecord/lib/active_record/migration/compatibility.rbの修正です。

各メソッドで独自に行っていたTableDefinitionのprepend処理をメソッドに切り出しています。


Add JSON attribute test cases for SQLite3 adapter

Active Recordの修正です。

SQLite3 adapterでJSON attributeを使用した場合のテストを追加しています。


Merge pull request #30702 from rmachielse/patch-1

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

Connection::Subscriptions#removeメソッドで、subscriptionを取得するのにfindメソッドを使用するよう修正しています。subscriptionを取得出来ない場合のエラーメッセージに詳細な情報が出るようにする為。

before

Could not execute command from ({"command"=>"unsubscribe", "identifier"=>"{\"channel\":\"SomeChannel\"}"}) [NoMethodError - undefined method `unsubscribe_from_channel' for nil:NilClass]:
/app/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:48:in `remove_subscription'
/app/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:44:in `remove'
/app/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:16:in `execute_command'
/app/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/base.rb:85:in `dispatch_websocket_message' /app/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.4/lib/action_cable/server/worker.rb:58:in `block in invoke'

after

Could not execute command from ({"command"=>"unsubscribe", "identifier"=>"{\"channel\":\"SomeChannel\"}"}) [RuntimeError - Unable to find subscription with identifier: {"channel":"SomeChannel"}]:
/app/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:76:in `find'
/app/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:44:in `remove'
/app/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:16:in `execute_command'
/app/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/base.rb:85:in `dispatch_websocket_message'
/app/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.4/lib/action_cable/server/worker.rb:58:in `block in invoke