なるようになるブログ

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

rails commit log流し読み(2016/08/23)

2016/08/23分のコミットです。

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

actionpack/CHANGELOG.md

activejob/CHANGELOG.md


Clearly state purpose of test directories

rails guideのA Guide to Testing Rails Applicationsの修正です。

Introduction to Testingの項、テスト用のディレクトリについて説明している箇所にviewのテストについての説明を追加、及びjobsディレクトリについての説明を追加しています。


Remove :action and :controller segments from routing guide

rails guideのRails Routing from the Outside Inの修正です。

Rails 5.0.0でdeprecatedになった:action:controller segmentを使用しているexampleをまとめて修正しています。


[ci skip] Update docs with Action Cable Redis dependency

rails guideのDevelopment Dependencies Installの修正です。

Action Cable Setupの項を新規に作成し、Redisのインストール手順を記載しています。


Remove the SchemaDumper options and change the default behavior

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

Merge pull request #25675 from TimPetricola/schema-no-standardized-column-widthsで追加された、schema.rbを生成する際に引数や型のスペースの自動整形を行うかどうかを指定する為のActiveRecord::SchemaDumper.standardized_argument_widthsActiveRecord::SchemaDumper.standardized_type_widthsオプションを削除し、デフォルトで自動整形を行わないよう修正しています。


Include the content of the flash in the auto-generated etag (#26250)

Action Packの修正です。

etagを生成する際に、flashのコンテンツを含むよう修正しています。

1. POST /messages
2. redirect_to messages_url, notice: 'Message was created'
3. GET /messages/1
4. GET /messages

上記流れで処理を行った場合に、 step 4で2で作成したflashが表示されてしまう(conditional getを使用している場合)、という問題があった為、それの対応としてetagにflashの値を含むようにしたとの事です。


Fix CI failure caused by df84e9867219e9311aef6f4efd5dd9ec675bee5c

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

Remove the SchemaDumper options and change the default behaviorの対応の影響でコケてたテストがあったのを修正しています。


Improve TagHelper#tag_option performance

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

ActionView::Helpers::TTagBuilder::TagHelper#tag_optionsメソッド内のStringをfreezeするよう修正、及び"を置換するのにRegexを使用していたのを、Stringを使用するよう修正しています。性能改善対応。


Merge pull request #26231 from philipqnguyen/scoped-dependent-destroy

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

has_manyメソッドのdocにdependent: :destroyについての説明を追加しています。


Merge pull request #26205 from pedaling-corp/fix/active-job-resque

activejob/lib/active_job/queue_adapters/resque_adapter.rbの修正です。

JobWrapper@queueインスタンスを設定するよう修正しています。

    class ResqueAdapter
       def enqueue(job) #:nodoc:
+        JobWrapper.instance_variable_set(:@queue, job.queue_name)
         Resque.enqueue_to job.queue_name, JobWrapper, job.serialize
       end

[resque-scheduler](https://github.com/resque/resque-scheduler]のメソッドで@queue変数を参照している箇所がある為、値を正しく取得出来るようにする為に対応したとの事です。


Merge pull request #26228 from kamipo/remove_unnecessary_any_and_many

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

CollectionAssociationCollectionProxyから#any?#many?メソッドを削除しています。

元々はCollectionProxyからCollectionAssociationのメソッドを呼ぶようになっていたのですが、今はCollectionProxyRelationを継承しており、直接メソッドを参照出来る為、不要になったCollectionAssociation及びCollectionProxyからメソッドを削除したとの事です。