なるようになるブログ

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

rails commit log流し読み(2017/03/21)

2017/03/21分のコミットです。

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


Merge pull request #27939 from kamipo/fix_select_all_with_legacy_binds

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

select_allメソッドのbinds引数に多重配列を渡した場合にエラーになってしまうバグがあったのを修正しています。


Merge pull request #28473 from kamipo/delegate_uniq_to_records

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

Include `Enumerable` in `ActiveRecord::Relation`ActiveRecord::RelationEnumerableをincludeするようになった事によに不要になったdelegate(collectmap等)を削除しています。


Fix the blog post template header

tasks/release.rbの修正です。

gemのveriyについての説明で、hashいnSHA-256を使用しているのに表題がSHA-1になってしまっていたのを修正しています。


Merge pull request #28406 from chukitow/feature/user-form-with-instead-of-form-for-scaffold

railties/lib/rails/generators/erb/scaffold/templates/_form.html.erbの修正です。

scaffold generatorが生成するviewで、form_forではなくform_withを使用するよう修正しています。


Default to yielding a form variable.

railties/lib/rails/generators/erb/scaffold/templates/_form.html.erbの修正です。

scaffold generatorが生成するviewで、formを格納する変数名をfと省略名を使用lしていたのを、略さずformとするよう修正しています。


Update the maintenance policy [ci skip]

rails guideのMaintenance Policy for Ruby on Railsの修正です。

Bug FixesSecurity Issuesの対象となるバージョンから4.2を削除しています。


Fix typo in Caching with Rails Guide [skip ci]

rails guideのCaching with Rails: An Overviewの修正です。

Caching in Developmentの項で、developmentdevelopementにタイポしている箇所があったのを修正しています。


Remove 5.0.0 entry from 5.1.0 CHANGELOG [ci skip]

railties/CHANGELOG.mdの修正です。

5.0.0に含まれていた対応が5.1.0のCHANGELOGに含まれてしまっていたので削除しています。


Merge pull request #28497 from jhawthorn/unscope_specific_where_value

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

whereに指定した値をunscopeした場合に、bindが正しく行われないバグがあったのを修正しています。

posts = Post.where(title: "Welcome to the weblog", body: "Such a lovely day")

posts.unscope(where: :title).to_sql
# SELECT "posts".* FROM "posts" WHERE "posts"."body" = 'Such a lovely day'

posts.unscope(where: :body).to_sql
# SELECT "posts".* FROM "posts" WHERE "posts"."title" = 'Such a lovely day'

# `"title" = "Welcome to the weblog"` となるべきが、`body`の値がbindされてしまっていた