なるようになるブログ

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

rails commit log流し読み(2020/09/01)

2020/09/01分のコミットです。

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


Proxying: sanitize Content-Type and Content-Disposition

Active Storageの修正です。

Active Storageのproxy処理で、Content-TypeとContent-Dispositionをsanitizeするよう修正しています。不正なコンテンツが指定された場合にXSSが実行されるのを防ぐ為。


Change belongs_to example to has_one [ci skip]

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

presenceオプションについて説明している箇所のexampleにbelongs_toを使用していたのを、has_oneを使用するよう修正しています。belongs_toはデフォルトでpresenceが指定されている為。


Move TruffleRuby check to select the autoloading mode to 6.1 defaults

railties/lib/rails/application/configuration.rbの修正です。

TruffleRubyでもデフォルトでZeitwerkを使用するようにする処理が、バージョンが6.0の場合のデフォルトに指定されていたのを、6.1の場合に指定するよう修正しています。


Use self[] instead of build directly in predicate builder

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

presence builderでbuildを直接使用せず、self[]を使用するよう修正しています。3rd partyのcodeで処理を記述しやすくする為。


Translate Mysql2 errors in Mysql2Adapter#quote_string

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

Mysql2Adapter#quote_stringメソッドでエラーになった場合に、Mysql2のエラーをそのままraiseしていたのを、ActiveRecord::StatementInvalidでエラーをwrapするよう修正しています。


Merge pull request #40151 from kamipo/return_time_after_save

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

changes_appliedの後にtime attributeの値がdecoratedされた値(ActiveRecord::Type::Time::Value)になってしまっていたのを、元のtimeの値を返すよう修正しています。


Raise ConnectionNotEstablished rather than StatementInvalid in Mysql2Adapter#quote_string

Active Recordの修正です。

各種メソッドで、connectionが接続されておらずエラーになった場合にもActiveRecord::StatementInvalidをraiseしていたのを、ActiveRecord::ConnectionNotEstablishedをraiseするよう修正しています。


Add CHANGELOG entry for #40106 [ci skip]

activerecord/CHANGELOG.mdの修正です。

whereで指定するtable名にassociation nameを指定出来るよう対応した、Allow where references association names as joined table alias namesの対応についてCHANGELOGにエントリーを追加しています。