なるようになるブログ

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

rails commit log流し読み(2018/02/11)

2018/02/11分のコミットです。

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


Unused core_ext

actionpack/lib/action_dispatch/routing/route_set.rbの修正です。

使用していないactive_support/core_ext/hash/sliceのrequireを削除しています。


Merge pull request #31133 from mohsen-alizadeh/sanitize_empty_and_nil_parameters_passed_to_select

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

select(nil) + select(xx)をチェーンした時にエラーになっていたのを、エラーにならないよう修正しています。

# before
User.select(nil).select(:username).to_sql
# => Arel::Visitors::UnsupportedVisitError: Unsupported argument type: NilClass. Construct an Arel node instead.

# after
User.select(nil).select(:username).to_sql
# => "SELECT `users`.`username` FROM `users`"