なるようになるブログ

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

rails commit log流し読み(2018/09/21)

2018/09/21分のコミットです。

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

railties/CHANGELOG.md


Merge pull request #33925 from rafaelfranca/rm-fix-column_defaults

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

column_defaultsメソッドでdefault attributesをcopyする際に、deep_dupメソッドを使用するよう修正しています。

attributeのdefaultにProcを使用している場合に、そのProcがcolumn_defaults呼び出し時に評価されるようにする為。


Merge pull request #33112 from yahonda/ci_postgresql10

.travis.ymlの修正です。

CIで使用するPostgreSQLのバージョンを10系に修正しています。


Make assert_<enqueued|performed>_with() compare hashes ignoring order of keys

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

assert_enqueued_withassert_performed_withメソッドで、argsオプションに指定した値とjobに指定されたargumentsが一致しているかどうかチェックする際に、値の順番が異なっても問題無いよう修正しています。

元々は、

assert_enqueued_with job: KwargJob, args: [{a: 1, b: 1}] do
  KwargJob.perform_later(b: 1, a: 1)
end

のassertがパスしなかった({a: 1, b: 1}{b: 1, a: 1}が一致しているとみなされなかった)のですが、このような場合でも問題無いようになっています。


Use utf8mb4 in all tests and examples

Active Recordの修正です。

各docやテストで使用するcharsetを全てutf8mb4に変更しています。

utf8mb4が使えないMySQL 5.1はMerge pull request #33853 from yahonda/use_utf8mb4_only_if_availableでサポートしなくなり、utf8を使用する必要は無いため。


Merge pull request #33891 from jgorman/remote_names

rails guideのContributing to Ruby on Railsの修正です。

Contributing to the Rails Codeの項で使用しているgitのリモートリポジトリの名称が統一されていなかったのを修正、及び、不要なpush処理等の削除を行っています。


Correct spelling in "Contributing to Ruby on Rails" guide [ci skip]

rails guideのContributing to Ruby on Railsの修正です。

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


Merge pull request #33906 from dark-panda/ignore-psqlrc-when-using-psql

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

PostgreSQL adapterでdb系タスクを実行する際に、~/.psqlrcファイルを読み込まないよう修正しています。

.psqlrcファイルにユーザの入力が必要なコマンド(e.g. \pset pager)等が定義されている場合に、タスクの実行の妨げになってしまう事がある為、それを避ける為、との事です。


Fix missing curly brace in documentation

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

has_and_belongs_to_manyメソッドのdoc内のexampleコードで、閉じ括弧が不足している箇所があったのを修正しています。


Add missing test case for redirect_to when request includes a port.

actionpack/test/controller/redirect_test.rbの修正です。

request hostにportが含まれている場合に、redirect_toメソッドが生成するURLにもportが含まれる事を確認するテストを追加しています。


Merge pull request #33922 from schneems/schneems/collection-caching-easier-to-understand

actionview/lib/action_view/renderer/partial_renderer/collection_caching.rbのdocの修正です。

各処理にドキュメントを追加しています。


Replace line items with chapters [ci skip]

rails guideのActive Record Associationsの修正です。

exmapleコードのLineItemクラスをChapterクラスに変更しています。

関連付けするクラスが、Association Guide replaces Order as example with Author-Book Example …OrderからBookに変更になっており、Bookと関連付けするクラスがLineItemなのはおかしいだろう、という事でChapterに変更されました。


Merge pull request #33932 from schneems/schneems/recyclable-key-support-cache

Active Support、railtiesの修正です。

cache versioningをサポートしていないcache storeを使用している(e.g. dalli_store)、かつ、cache versioningを有効化している場合に、使用しているcache storeではcaching versioningは使用出来ない旨エラーをraiseするよう修正しています。