なるようになるブログ

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

rails commit log流し読み(2015/12/19)

2015/12/19分のコミットです。

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

actionview/CHANGELOG.md


[ActionCable] test perform action with default action

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

#perform_actionメソッドを引数無しで呼び出した際に、#receiveメソッドが呼ばれる事を確認するテストを追加しています。


Don't need to use Array.wrap

railties/lib/rails/generators/rails/plugin/templates/%name%.gemspecrailties/lib/rails/generators/rails/plugin/templates/Gemfileの修正です。

gemのバージョン指定処理から、不要なArray.wrapの呼び出し処理を削除しています。


Delete duplicate test

activesupport/test/caching_test.rbの修正です。

キャッシュに設定されてない値を読み込んだ時にnilが返ってくるテストが重複していたので、片方削除しています。


Fix test that fails in isolation

activesupport/test/file_update_checker_shared_tests.rbの修正です。

FileUpdateCheckerのテストを単体で動かした場合に、NameError: uninitialized constant EventedFileUpdateCheckerTest::Listenでエラーになっていたので、require 'listen'を追加し対応しています。


[ActionCable] Test invalid action on channel

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

#perform_actionに不正なアクション名を指定した場合のテストを追加しています。


Fix receive spelling and add whitespace

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

receiverecieveにタイポしていたのを修正しています。


Fix receive spelling

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

receiverecieveにタイポしている箇所がまだあったのを修正しています。


Merge pull request #22658 from greysteil/handle-specified-schema-in-index-remove

#remove_indexメソッドnameオプションを渡した場合の処理を、Ignore index name in index_exists? when not passed a name to check for by greysteil · Pull Request #19456 · rails/rails の対応の際に誤って削除してしまったので、nameオプションを渡した場合に正しく動作するよう処理を戻しています。


Add task to test the release preparation

Rakefiletasks/release.rbの修正です。

rails リリース準用のrake taskを追加しています。


Change alpha to beta1 to prep for release of Rails 5

gem versionの修正です。

コンポーネントのバージョンを5.0.0.alpha -> 5.0.0.beta1に修正しています。


debug_missing_translation configuration added to action_view

actionview/lib/action_view/helpers/translation_helper.rbactionview/lib/action_view/railtie.rbの修正です。

I18n.translateメソッドを使用、かつ指定したkeyが存在しなかった場合に、見つからなかったkeyの値をspanタグで囲んで表示するようになっていたのですが、spanタグで囲うかどうかをconfigの値(config.action_view.debug_missing_tranlation)で指定出来るよう対応しています。


Add CHANGELOG headers for Rails 5.0.0.beta1

コンポーネントCHANGELOGの修正です。

CHANGELOGのヘッダーにRails 5.0.0.beta1 (December 18, 2015)を追加しています。


Fix typo in CHANGELOG

activerecord/CHANGELOG.mdの修正です。

ActiveRecordAcriveRecordにタイポをしている箇所があったのを修正しています。


[ActionCable] declare asset_logged private

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

テスト用のヘルパーメソッドである#assert_loggedをprivate メソッドに変更しています。


fix typo in config value [ci skip]

actionview/CHANGELOG.mdの修正です。

debug_missing_translationdebug_missing_tranlationにタイポしている箇所があったのを修正しています。


Merge pull request #19423 from yuroyoro/fix_performance_regression_of_preloading_has_many_through_relation

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

ActiveRecord::Associations::Preloader::ThroughAssociation#associated_records_by_ownerメソッドで、必要な際に毎回CollectionAssociation#readerメソッドを呼び出していたのを、既にassociationをload済みの場合は、load済みの値を使用するよう修正しています。

Rails 3.2 -> 4.0の間でhas_many_through associationのpreload処理のパフォーマンスが大幅に悪化する、という問題が発生していて、その対応として行っています。

参考:Major performance regression when preloading has_many_through association · Issue #12537 · rails/rails


initializers/cookies_serializer is not new to 5.0

railties/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rbのdocの修正です。

cookies_serializer.rbで、config.action_dispatch.cookies_serializerの値のデフォルトはRails 5から:jsonになった旨コメントがあったのですが、実際は4.1から:jsonになっている為、該当のコメント部分削除しています。


Explain what initializer/config_serializer does

railties/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rbのdocの修正です。

config.action_dispatch.cookies_serializerについての説明、及び設定出来る値についてコメントを追加しています。


Add No Doc

railties/lib/rails/generators/actions/create_migration.rbのdocの修正です。

Rails::Generators::Actions::CreateMigrationクラスに、:nodoc:を追加しています。


Remove blank line generated in config.ru

railties/lib/rails/generators/rails/app/templates/config.ru.ttの修正です。

skip_action_cableを指定した場合に、デフォルトで生成されるconfig.ruに不要な空行を追加されてしまっていたのを、不要な空行が生成されないよう修正しています。


Merge pull request #22479 from RobinClowers/fix-cache-notification-order

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

ActiveSupport::Cache::Store#fetchメソッドを呼び出して、かつ指定したkeyがヒットしなかった場合のnofiticationの順番が、本来、

  1. cache_read.active_support
  2. cache_generate.active_support
  3. cache_write.active_support

になるべきなのに、

  1. cache_generate.active_support
  2. cache_write.active_support
  3. cache_read.active_support

になってしまっていた、というバグがあったのを修正しています。


Remove .DS_Store

Add No Doc · rails/rails@c640b2cで誤ってコミットされてしまった.DS_Storeを削除しています。


Deprecation warning now targets at 5.1

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

ActiveSupport::Deprecation#newメソッドdeprecation_horizon引数のデフォルト値を5.0 -> 5.1に変更しています。5.0がリリースされ、今後deprecateになるのは基本5.1がターゲットになる為。


Remove unused test/schema/mysql_specific_schema.rb

Remove legacy mysql adapter by seuros · Pull Request #22642 · rails/rails の対応により不要になったactiverecord/test/schema/mysql_specific_schema.rbを削除しています。


Update README.md

actioncable/README.mdの修正です。

A full-stack exampleの項、JS側のexampleで使用する変数名をタイポしていたのを修正しています。

#= require action_cable

 @App = {}
-App.cable = Cable.createConsumer("ws://cable.example.com")
+App.cable = ActionCable.createConsumer("ws://cable.example.com")

docs, follow up to #22699. [ci skip]

actioncable/README.mdの修正です。

Running the cable serverの項にも同様に変数名をタイポしている箇所があったのを修正しています。