2020/09/14分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- All connection adapters
execute
now raisesActiveRecord::ConnectionNotEstablished
rather thanActiveRecord::InvalidStatement
when they encounter a connection error. Mysql2Adapter#quote_string
now raisesActiveRecord::ConnectionNotEstablished
rather thanActiveRecord::InvalidStatement
when it can't connect to the MySQL server.connects_to
can only be called onActiveRecord::Base
or abstract classes.
Remove MemCacheStore#write_entry options nil check
activesupport/lib/active_support/cache/mem_cache_store.rb
の修正です。
MemCacheStore#write_entry
メソッドから不要なoptions
がnilの場合のチェックを削除しています。
Merge pull request #40212 from Shopify/active-record-exceptions-wrapping
Active Recordの修正です。
Mysql2Adapter#quote_string
でMySQL serverに接続出来なかった場合、ActiveRecord::InvalidStatement
ではなくActiveRecord::ConnectionNotEstablished
をraiseするよう修正、及び、全てのadapterのexecute
メソッドで、接続エラーになった場合にもActiveRecord::InvalidStatement
ではなくActiveRecord::ConnectionNotEstablished
をraiseするよう修正しています。
Revert "Merge pull request #19881 from sikachu/silence-mysql-errno-warning"
Revert "Merge pull request #19881 from sikachu/silence-mysql-errno-warning"で対応した修正が、先のActiveRecord::ConnectionNotEstablished
の修正で戻ってしまっていた為、再度同じ修正をコミットしています。
Ensure connects_to
can only be called on base or abstract classes
activerecord/lib/active_record/connection_handling.rb
の修正です。
connects_to
メソッドをActiveRecord::Base
かabstract classでのみ実行出来るようチェックを追加しています。
元々ドキュメントではActiveRecord::Base
かabstract classでのみ使用するよう説明があったのですが、コード上はどのクラスでも実行出来るようになっていました。sub classでconnects_to
すると重複したconnectionをオープンしたり、大量のconnectionをオープンしてしまったりする可能性がある為、コード上もActiveRecord::Base
かabstract classでのみ使用するよう修正しています。