なるようになるブログ

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

rails commit log流し読み(2019/05/02)

2019/05/02分のコミットです。

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


Updates to getting started per Rails 6.0 changes [ci skip]

rails guideのGetting Started with Railsの修正です。

Rails 6.0の変更に合わせてguideを修正しています(CoffeeScriptmini_racer gemに関する説明を削除、model generatorでreferences typeを指定した場合にmigrationファイルにnull: falseを指定)。


Merge pull request #34642 from azimux/improve-hwia-initialize-by-skipping-to_h-if-already-a-hash

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

HashWithIndifferentAccess#initializeで引数に指定したオブジェクトがHashだった場合に、不要なto_hashメソッドの呼び出しを行わないよう修正しています。性能向上の為。


Merge pull request #35337 from abhaynikam/35265-remove-unused-argument-layout-from-rendered-template

Action Viewの修正です。

RenderedTemplateから使用していないlayout attributeを削除しています。


Merge pull request #36149 from alexcameron89/add_active_storage_rn

rails guideのRuby on Rails 6.0 Release Notesの修正です。

Active Storageの変更点についてRelease Notesに記載しています。


Make scope arity check consistent (#36134)

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

scopeの引数をチェックする際に、arityが0以上かどうかをチェックしていたのを、arityが0じゃないかどうかをチェックするよう修正しています。arityが負の値になる事がある為。

参考:Class: Proc (Ruby 2.6.2)


Update asset compression text [ci skip]

rails guideのGetting Started with Railsの修正です。

Starting up the Web Serverの項のJavaScriptに関する説明の言い回しを修正しています。


Merge pull request #36152 from prathamesh-sonpatki/active-support-notes

rails guideのRuby on Rails 6.0 Release Notesの修正です。

Active Supportの変更点についてRelease Notesに記載しています。


Namespace association extension modules under the owner model

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

association extension modulesを定義する際に、Objectに対してmoduleを追加していたのを、自身のmodelに対してmoduleを追加するよう修正しています。元の方法だと、autoloaderにZeitwerkを使用している場合に、定数の再定義が行われてしまい、結果Rubyのwarningが表示されてしまう為。