なるようになるブログ

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

rails commit log流し読み(2018/09/30)

2018/09/30分のコミットです。

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


Make test_initialize_with_invalid_attribute work correctly

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

ActiveRecord::Baseを継承しているclassのinitializeメソッドに、不正なattributesを指定した場合にエラーになることを確認するテストが正しく動作していなかった(正常なattributeだけを指定していた)のを修正しています。


Remove visit_Fixnum and visit_Bignum

activerecord/lib/arel/visitors/depth_first.rbactiverecord/lib/arel/visitors/dot.rbの修正です。

もう不要なvisit_Fixnumvisit_Bignumメソッドを削除しています。


Use private attr_reader in Arel

arelの修正です。

attr_readerの可視性がprotectedになっていたのをprivateに修正しています。

Ruby 2.2以下でprivate attribute?のwarningが出てしまう為protectedになっていたのですが、masterでサポートしているバージョンは2.3以上になので、privateに修正しています。


visitor.accept doesn't handle &block

activerecord/lib/arel/visitors/to_sql.rbの修正です。

visitor.acceptメソッドに受け付けていない&block引数を渡している箇所があったのを修正しています。


SQLString#compile is no longer used since 53521a9e39b9d8af4165d7703c36dc905f1f8f67

activerecord/lib/arel/collectors/sql_string.rbの修正です。

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


Handle DELETE with LIMIT in Arel

arelの修正です。

DELETE実行時にLIMIT + ORDER BYを指定出来るよう修正しています。

MySQL 8.0から上記構文を使用出来るようになっている為。

参考:MySQL :: MySQL 8.0 Reference Manual :: 13.2.2 DELETE Syntax


Place PartialQuery and PartialQueryCollector in the same file

activerecord/lib/active_record/connection_adapters/abstract/database_statements.rbactiverecord/lib/active_record/statement_cache.rbの修正です。

PartialQueryクラスとPartialQueryCollectorクラスを同じファイルに定義するよう修正しています。