なるようになるブログ

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

rails commit log流し読み(2020/06/17)

2020/06/17分のコミットです。

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


setup.tt comment: "at anytime" -> "at any time"

railties/lib/rails/generators/rails/app/templates/bin/setup.ttのコメントの修正です。

コメント内のグラマーの修正を行っています。


Make where_sql more few code

Active Recordの修正です。

where_sqlを実行するのに専用のvisitorクラスで処理を行っていたのを、where_sqlで直接処理を行うようにしてvistorクラスを削除しています。


Avoid to use slower define_method for AcceptsMultiparameterTime

activemodel/lib/active_model/type/date_time.rbactivemodel/lib/active_model/type/helpers/accepts_multiparameter_time.rbの修正です。

AcceptsMultiparameterTimeで遅いdefine_methodメソッドを使用しないようリファクタリングしています。


Merge pull request #39644 from kamipo/remove_unused_operator

activerecord/lib/arel/nodes/equality.rbの修正です。

使用していないEquality#operatorメソッドを削除しています。


Merge pull request #39634 from kamipo/allow_difference_for_and_or

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

and/orメソッドで、relationに明示的に違う値が指定されてない限り、restrictionチェックでエラーにならないよう修正しています。


Merge pull request #39612 from kamipo/faster_attributes

Active Modelの修正です。

attributeの変更チェックを、実際にattributeが変更された際に行うよう修正しています。

これにより、attributeの参照(Model.find(1).attr_name)では変更チェック用オブジェクトの生成が行われない為、高速に動作するようになっています。


Only allow ActionableErrors if show_detailed_exceptions is enabled

actionpack/lib/action_dispatch/middleware/actionable_exceptions.rbの修正です。

show_detailed_exceptions configが指定されていないenvでもActionableErrorsが実行出来てしまう(pending migrationがあった場合に任意のユーザが実行出来てしまう)バグがあったのを修正しています。この問題はSecurity Issueとして登録されており、この修正を行ったRails 6.0.3.2がリリースされています。

Ref: [CVE-2020-8185] Untrusted users able to run pending migrations in production