なるようになるブログ

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

rails commit log流し読み(2024/01/02)

2024/01/02分のコミットです。

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

activerecord/CHANGELOG.md


Merge pull request #50384 from skipkayhil/hm-fix-alphabetical-configuring

rails guideのConfiguring Rails Applicationsの修正です。

Rails General Configurationのセクションにある各configをアルファベット順になるよう修正しています。


Add brakeman as development dependency

Gemfileの修正です。

brakeman gemをdependencyに追加しています。Railtiesのtestで使われている為。


Apply autocorrection by RuboCop to files generated by bin/rails generate (#50506)

railties/lib/rails/configuration.rbrailties/lib/rails/generators/rails/app/templates/config/environments/development.rb.ttの修正です。

bin/rails generateでファイルを生成した際に、自動で生成されたファイルに対してRubocopのautocorrectを自動で実行するかどうかをconfigで指定出来るよう修正しています。自動で実行したい場合、config.generators.apply_rubocop_autocorrect_after_generate!を指定すれば良いようになっています。


Utilize new enum syntax

rails guideのActive Record and PostgreSQLの修正です。

enumのexampleで、Allow new syntax for enum to avoid leading _ from reserved optionsで追加された新しいシンタックスを使用するよう修正しています。


Switch to new enum syntax in example code [ci-skip]

docの修正です。

先のコミットと同様に、doc内にあるenumのexampleで、Allow new syntax for enum to avoid leading _ from reserved optionsで追加された新しいシンタックスを使用するよう修正しています。


Add a default yield :head to layouts/application.html.erb (#50527)

railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.ttの修正です。

generatorで生成するapplication.html.erbyield :headの指定を追加しています。templateファイルからheadにmetaタグ等を追加するのはよくあるパターンの為、デフォルトでそれを出来るようにしておくのが良いだろう、という事で修正されています。


Tune CI template for uploading artifact (#50533)

railties/lib/rails/generators/rails/app/templates/github/ci.yml.ttの修正です。

actions/upload-artifact actionを最新バージョンに更新、及び、スクリーンショットが無い場合はアップロード処理を実行しないよう修正しています。


Replace old placeholder icon variants with a single one (#50526)

railtiesの修正です。

apple-touch-icon-precomposed.pngapple-touch-icon.png等デフォルトで複数のiconを生成していたのを、icon.pngだけを生成するよう修正しています。


bundle update rubocop --conservative (#50515)

Rubocopを最新バージョンに更新、及び各ファイルに最新のcopを適用しています。


Document apply_rubocop_autocorrect_after_generate! in configuration guide (#50532)

rails guideのConfiguring Rails Applicationsの修正です。

Apply autocorrection by RuboCop to files generated by bin/rails generate (#50506)で追加されたapply_rubocop_autocorrect_after_generate!メソッドについての説明を追加しています。


Fix a flaky test in query_assertions_test.rb (#50503)

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

query_assertions_test.rb内の幾つかのテストがランダムにfailするようになってしまっていたのを修正しています。


Allow overriding SQLite defaults from database.yml (#50460)

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

SQLiteでデフォルトで使用するPRAGMAの設定をdatabase.ymlで指定出来るよう修正しています。

database: storage/development.sqlite3
timeout: 5000
pragmas:
  journal_mode: off
  temp_store: memory

Fix test

railties/test/generators/scaffold_generator_test.rbの修正です。

routes fileでコメントアウトするroutingに、 Add default pwa manifest and service worker fileで追加予定のrouteも追加しています。