なるようになるブログ

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

rails commit log流し読み(2023/02/14)

2023/02/14分のコミットです。

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

activejob/CHANGELOG.md

activesupport/CHANGELOG.md


Add custom user in dockerfile

railties/lib/rails/generators/rails/app/templates/Dockerfile.ttの修正です。

Docker内で処理を行う際にnon-root userで処理を行うよう修正しています。


Merge pull request #46603 from Mangara/mangara-multi-enqueue

Active Jobの修正です。

複数のjobをまとめて登録する為のperform_all_laterメソッドを追加しています。

ActiveJob.perform_all_later(MyJob.new("hello", 42), MyJob.new("world", 0))
user_jobs = User.pluck(:id).map { |id| UserJob.new(user_id: id) }

ActiveJob.perform_all_later(user_jobs)

job adapterがbulk用のAPIを提供している場合はそのAPIを使用するようになっており、そうでない場合はActive Jobがjobを1つづつ登録するようになっています。なお、このPRではbulk用のAPIを使用するようになっているのはSidekiqのみです。


Merge pull request #47345 from Cofense/arel-predicate-exclusive-infinite-range-greater-than

activerecord/test/cases/arel/attributes/attribute_test.rbの修正です。

Arelでconditionにexclusive open-ended rangeを指定した場合のテストを追加しています。


Refactor query constraints feature set

Active Recordの修正です。

query constraintsに関するリファクタリングを行っています。query_constraintsがmodelに設定されている場合のみquery_constraints_listが値を返すよう修正、primary_keyメソッドをsingle IDを保持している場合のみ使用するよう修正、などの変更が行われています。


Don't run the adapter tests when a test selection is made

activerecord/test/support/tools.rbrailties/lib/rails/test_unit/runner.rbの修正です。

railsのテストをファイル名を指定して実行した場合に、各adapterのテストが実行されないよう修正しています。


Merge pull request #47246 from Shopify/support-joins-for-assoc-with-composite-foreign-key

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

composite foreign keyを使用しているassociationのjoin処理を行えるよう修正しています。


Fixes issue: Link to SQL Reference guide #47369

rails guideのActive Record Basicsの修正です。

SQL及びRDBMSに関しての参照リンクを、登録無しや広告無しで参照出来るサイトへのリンクに修正しています。


Add AS instrument hook to guides

rails guideのActive Support Instrumentationの修正です。

enqueue_all.active_job hookについての説明を追加しています。


Rename Dockerfile user to "rails"

railties/lib/rails/generators/rails/app/templates/Dockerfile.ttの修正です。

Docker内で処理を行う際のユーザ名をrailsに変更しています。


Use NOTE to callout db:mysql:build_user possible gotcha

rails guideのInstalling Rails Core Development Dependenciesの修正です。

MySQLのDBのセットアップを行う際の注意事項がNOTEとして表示されるよう修正しています。


Stub Time.new() in TimeHelpers#travel_to

activesupport/lib/active_support/testing/time_helpers.rbの修正です。

TimeHelpers#travel_toメソッドでTime.new()をstubするよう修正しています。