なるようになるブログ

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

rails commit log流し読み(2016/11/19)

2016/11/19分のコミットです。

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

actionpack/CHANGELOG.md


Fix ActionDispatch::IntegrationTest#open_session

actionpack/lib/action_dispatch/testing/integration.rbの修正です。

ActionDispatch::IntegrationTest#open_sessionでsessionをresetするよう修正しています。sessionが異なるrequest間で共有されてしまうのを防ぐ為。


Fix incorrect output from rails routes when using singular resources issue #26606

actionpack/lib/action_dispatch/routing/mapper.rbの修正です。

routesでresourceを使用していた場合に、routesタスクの実行結果にshow actionに対するhelper methodが表示されないバグがあったのを修正しています。

# routes.rb
resource :profile, only: [:show]
# before
        GET    /profile(.:format)                                 profiles#show
# after
profile GET    /profile(.:format)                                 profiles#show

Merge pull request #27092 from prathamesh-sonpatki/https-source-bundler

railties/lib/rails/generators/rails/app/templates/Gemfileの修正です。

rails newで生成されるGemfileの先頭にgithubショートハンドを使っている場合にhttpsプロトコルを使う為の対応を追加しています。

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

bundler 1.13.0からGemfileにgithubショートハンドを使用している場合にwarning(The git sourcegit://github.com/rails/sass-rails.gituses thegitprotocol, which transmits data without encryption. Disable this warning withbundle config git.allow_insecure true, or switch to thehttpsprotocol to keep your data secure.)が出るようになったので、その対策としてgitプロコトルではなくhttpsプロコトルを使うよう上書きするようにしています。


move CHANGELOG entry to the appropriate file [ci skip]

ActionDispatch::IntegrationTest#open_sessionでsessionをresetするよう修正した対応のエントリーがrailtiesCHANGELOGに記載されていたのを、actionpackCHANGELOGに記載するよう修正しています。


Merge pull request #27057 from kamipo/fix_race_condition

activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rbの修正です。

ActiveRecord::ConnectionAdapters::ConnectionPool#with_new_connections_blockedメソッドにrace conditionがあり、複数スレッドで実行した場合にnew connectionsが使用出来るかどうかのチェックが正しく行われないバグがあったのを修正しています。


Add missing test for singular resource output in rake routes

railties/test/application/rake_test.rbの修正です。

rails routesでsingular resourceを出力した場合のテストを追加しています。