なるようになるブログ

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

rails commit log流し読み(2019/07/01)

2019/07/01分のコミットです。

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


adds two sections to the upgrading notes for autoloading [skip ci]

rails guideのUpgrading Ruby on Railsの修正です。

Autoloadingの項に、Having "app" in the autoload pathsEager loading and autoloading are consistentセクションを追加しています。

Having "app" in the autoload pathsにはapp配下は基本的に自動でautoload pathに追加される旨の説明と、autoloadに追加したくないディレクトリがある場合の対応方法についての説明が記載されています。

Eager loading and autoloading are consistentには、classic モードではファイル名とそのファイルに定義されているクラス・モジュール名が一致しないケースでもeager loadは成功していた(autoloadは失敗していた)のが、zeitwerk モードでは両方失敗し、autoloadとeager loadでの挙動が一致するようになった事についての説明が記載されています。


bumps Zeitwerk

activesupport/activesupport.gemspecGemfile.lockの修正です。

Zeitwerkのバージョン指定を>= 2.1.8に修正しています。先のコミットで説明が追加されたeager loadの挙動の変更が含まれているのが2.1.8な為。

rails commit log流し読み(2019/06/30)

2019/06/30分のコミットです。

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


Make bin/setup test pass even if the database does not exist

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

bin/setupに関するテストが、テスト内で作成するDBが事前に作成されてないとエラーになってしまうようになっていたのを、DBが無くてもエラーにならないよう修正しています。

rails commit log流し読み(2019/06/29)

2019/06/29分のコミットです。

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


Link to top of PR as well as other links [ci skip]

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

Add the ability to disable scopes generated byActiveRecord.enum`.の対応のPRへのリンクが files(https://github.com/rails/rails/pull/34605/files)へのリンクになっていたのを、他のエントリー同様PRのTOPへのリンクに修正しています。

rails commit log流し読み(2019/06/28)

2019/06/28分のコミットです。

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


Address to "DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1"

activerecord/test/schema/schema.rbの修正です。

テストで、validates_uniqueness_ofに指定するカラムにcollationを指定するよう修正しています。uniqueness validatorに関するdeprecationメッセージが出力されないようにする為。


Fix broken url configs

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

DATABASE_URLが指定されている場合に、database.ymlに定義されているその他のconfigが無視されしまうバグがあったのを修正しています。


warning: instance variable @serial not initialized (#36556)

activerecord/lib/active_record/connection_adapters/postgresql/column.rbの修正です。

yaml dump / load時にserialのdump / loadが正しく行われてなかったのを修正しています。


Add "SCHEMA" to the query in configure_connection like as other adapters

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

MySQL adapterで、connectionに対してconfigを指定するクエリーがSCHEMAとして扱われるよう修正しています。

connectionの再接続が行われた際に、assert_queriesで実行したクエリーが無視されるようにする為。

rails commit log流し読み(2019/06/27)

2019/06/27分のコミットです。

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


[ci skip] Update free-programming-books link in getting started guide

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

"List of Free Programming Books"へのリンクを、現在の正しいリポジトリ(https://github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md#ruby)に修正しています。


Load initial database.yml once, and warn if we can't create tasks

activerecord/lib/active_record/railties/databases.rakeactiverecord/lib/active_record/tasks/database_tasks.rbの修正です。

複数DB用のrakeタスクを生成する際に、database.ymlのパースでエラーになった場合、エラーがそのままraiseされて処理が継続出来ないようになっていたのを、エラーはraiseせずパースで失敗した旨のwarningを出すようだけにし、処理は継続するよう修正しています。

上記のrakeタスク生成処理はアプリ起動する前に行われる為、database.ymlでアプリの情報が参照されてエラーになるのを避ける為、database.yml内のERBをダミーの情報で置き換えるようになっています。が、database.ymlで置き換えられないような複雑なERBを使用している場合に、rakeタスク実行時にエラー&ユーザがそのエラーが何故発生しているかわからない、という問題が発生していた為、上記対応を行っています。

rails commit log流し読み(2019/06/26)

2019/06/26分のコミットです。

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


[ci skip] Refer actionmailbox and actiontext in the guide

rails guideのThe Rails Initialization Processの修正です。

Railsがデフォルでロードするgem、及び、railties/lib/rails/all.rbでロードするファイルのリストにAction MailboxとAction Textを追加しています。


length(title) is a safe SQL string since #36448

activerecord/test/cases/relations_test.rbの修正です。

SQLlength(xx)を実行する際にArel.sqlメソッドでラップしていたのを削除しています。

Allow column name with function (e.g. length(title)) as safe SQL stringlength(xx)は安全なSQLと見なされるようになった為。

rails commit log流し読み(2019/06/25)

2019/06/25分のコミットです。

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


Merge pull request #36210 from vishaltelangre/raise-record-invalid-when-associations-fail-to-save-due-to-uniqueness-failure

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

save!メソッドでassociation recordがuniqueness validationにより保存に失敗した場合に、ActiveRecord::RecordInvalidがraiseされない(nilがかえる)バグがあったのを修正しています。


Merge pull request #36530 from benoittgt/source_annotation_deprecation_issue

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

DeprecatedConstantProxyクラスでrequireを使用する際に、明示的にKernelのrequireを使用するよう修正しています。

- require "active_support/inflector/methods"
+ Kernel.require "active_support/inflector/methods"

DeprecatedConstantProxyの親クラスであるDeprecationProxyrequireをundefされてしまっており、独自にrequireを定義しているメソッドと合わせて使用した場合にその定義されているrequireが使用され、結果予期せぬ挙動になってしまう事があった為、との事です。


Replace the www.robotstxt.org URL with https one [ci skip]

Rails guideのConfiguring Rails Applications、及び、 railties/lib/rails/generators/rails/app/templates/public/robots.txtの修正です。

www.robotstxt.orgへのURLをhttpからhttpsに修正しています。