なるようになるブログ

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

rails commit log流し読み(2021/02/17)

2021/02/17分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activerecord/CHANGELOG.md

actionview/CHANGELOG.md


Implement Relation#load_async to schedule the query on the background thread pool

Active Recordの修正です。

クエリをスレッドプールから非同期に実行する為のload_asyncメソッドを追加しています。 なお、バックグランドで実行される前に結果を参照した場合、フォアグラウンドでqueryが実行されるようになっています。

def index
  @categories = Category.some_complex_scope.load_async
  @posts = Post.some_complex_scope.load_async
end

Deprecate render locals to be assigned to instance variables

actionview/lib/action_view/template.rbの修正です。

render localでインスタンス変数を設定出来る(render 'partial', :@name => "Maceo"とすると@nameインスタンス変数が定義されてしまう)、という挙動をdeprecateにしています


Added #without as alias for #excluding.

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

ActiveRecord::Relation#excludingのaliasとして#withoutを定義しています。


Merge pull request #41463 from jhawthorn/isolated_engine_controller_subclasses

actionpack/lib/abstract_controller/railties/routes_helpers.rbの修正です。

engine内の継承したcontrollerでpathの再定義を行った際に、定義した内容がrouteに反映されないバグがあったのを修正しています。


Remove useless branch for the array predicate handler

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

excluding!メソッドについて、不要な分岐処理を削除、及び、不要なspawnを実行しないようリファクタリングしています。


alias :without :excluding

Active Record、Active Supportの修正です。

aliasを定義するのにdefでメソッドを定義していたのを、aliasを使用するよう修正しています。


Update Rails version in depraction and add non-deprecated code

actionview/lib/action_view/template.rbの修正です。

deprecateメッセージ内のrender localでインスタンス変数を設定出来なくなるRailsのバージョンが誤っていたのを修正しています。


Fix the duplicated media attribute in stylesheet_link_tag

actionview/lib/action_view/helpers/asset_tag_helper.rbの修正です。

stylesheet_link_tagメソッド内のmedia attributeのチェック方法に誤りがあったのを修正しています。