なるようになるブログ

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

rails commit log流し読み(2021/09/10)

2021/09/10分のコミットです。

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

activerecord/CHANGELOG.md


Avoid scoping update transaction when calling update! on a relation

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

ActiveRecord::Relation#update!からのcallback実行処理がscopingの影響を受けるようになってしまっていたのを、影響を受けないよう修正しています。ActiveRecord::Relation#updateと挙動を合わせる為。


Add a template per case on asset debugging tests

railties/test/application/asset_debugging_test.rbの修正です。

asset debuggingのテストでテスト毎に異なるtemplateを使用するよう修正しています。更新検知のタイミングによりテストがfailしてしまうのを避ける為。

rails commit log流し読み(2021/09/09)

2021/09/09分のコミットです。

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

railties/CHANGELOG.md


Depend on ruby/debug, replacing Byebug

railtiesの修正です。

rails newで新規に作成したアプリケーションでは、デバッガーにbyebugではなくruby/debugを使用するよう修正しています。debugがCRuby開発チームがメンテしているデバッガーである事と、byebugだとZeitwerkと一部非互換がある(Incompatibility with Zeitwerk)為。


Revise style

railties/lib/rails/autoloaders.rbrailties/lib/rails/autoloaders/inflector.rbの修正です。

ファイルのフォーマットを修正しています。


Upgrade debug to 1.0.0

railtiesの修正です。

debug gemのバージョンを1.0.0に更新しています。


Document upgrading instructions for Spring

rails guideのUpgrading Ruby on Railsの修正です。

Upgrading from Rails 6.1 to Rails 7.0に、Springを使用している場合Spring 2.2.0以上を使う必要がある旨説明を追加しています。


Document upgrading instructions for Spring (again)

rails guideのUpgrading Ruby on Railsの修正です。

先のコミットで追加したUpgrading from Rails 6.1 to Rails 7.0内のSpringの説明で、必須バージョンの記載が誤っていた(2.2.0 -> 3.0.0)のを修正しています。


Turn on ruby/debug by default in dev + test

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

debug gemにrequire: falseが指定されていたのを削除し、dev / test envではデフォルト有効になるよう修正しています。


Style

railties/lib/rails/generators/rails/app/templates/Gemfile.ttrailties/lib/rails/generators/rails/plugin/templates/Gemfile.ttの修正です。

SymbolのArrayを定義するのに%i記法を使用するよう修正しています。


Require by default for plugins too

railties/lib/rails/generators/rails/plugin/templates/Gemfile.ttの修正です。

pluginでもデフォルトでdebug gemが有効になるよう修正しています。


Use the same description

railties/lib/rails/generators/rails/app/templates/Gemfile.ttrailties/lib/rails/generators/rails/plugin/templates/Gemfile.ttの修正です。

Rails applications用のGemfileとplugin用のGemfileで、debug gemに対して同じコメントを記載するよう修正しています。

rails commit log流し読み(2021/09/08)

2021/09/08分のコミットです。

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


Add --css app generator option (#43177)

railtiesの修正です。

rails newで新規に作成したアプリケーションでは、デフォルトでtailwindcss-railsを使用するようになっていたのを、cssオプションで使用するbundler/processorを指定出来るよう修正しています。bundler/processortailwindpostcsssassが指定出来るようになっており、postcsssassを指定した場合はrails/cssbundling-railsが使用されるようになっています。


Let jsbundling-rails expand without requiring a change in Rails

railties/lib/rails/generators/app_base.rbの修正です。

jsbundling-railsでサポートしているJSライブラリをRails側で認識しないで良いよう修正しています。

rails commit log流し読み(2021/09/07)

2021/09/07分のコミットです。

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

activerecord/CHANGELOG.md


Merge pull request #43171 from yykamei/replace-location-with-request-in-process_action.action_controller

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

process_action.action_controller hookのpayloadを最新のデータに更新しています。


Use polymorphic_class_for over constantize

activerecord/lib/active_record/associations/belongs_to_association.rbactiverecord/lib/active_record/associations/builder/belongs_to.rbの修正です。

polymorphic associationを取得するのにpolymorphic_class_forメソッドを使っていない箇所が残っていたのを修正しています。

rails commit log流し読み(2021/09/06)

2021/09/06分のコミットです。

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


Enable Style/ExplicitBlockArgument cop

Style/ExplicitBlockArgument copを追加、及び、各ファイルにcopを適応しています。


Add back Lint/UselessAssignment

.rubocop.ymlactiontext/lib/generators/action_text/install/install_generator.rbの修正です。

Javascript generator option with choices (#43160)で削除されてしまっていたLint/UselessAssignment copを再度有効化しています。


Use the combined jsbundling-rails gem instead of individual js bundler gems (#43172)

railtiesの修正です。

esbuild-railsや、rollupjs-railsなどJS bundler gemsを個別に使用していたのをやめて、新たに追加したrails/jsbundling-rails gem経由で各gemのinstall処理を行うよう修正しています。

rails commit log流し読み(2021/09/05)

2021/09/05分のコミットです。

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


Fix trailing whitespace

actioncable/lib/rails/generators/channel/channel_generator.rbの修正です。

ファイル末尾の空白を削除しています。


Add rollup as JavaScript option (#43164)

railties/lib/rails/generators/app_base.rbrailties/lib/rails/generators/rails/app/app_generator.rbの修正です。

rails newjavascriptオプションにrollup(rails/rollupjs-rails)を追加しています。


Move the default autoloaders inflector to railties

Active Support、railtiesの修正です。

autoloaders inflectorをActive Supportからrailtiesに移動しています。


Fix rubocop offense

actioncable/lib/rails/generators/channel/channel_generator.rbの修正です

ファイル末尾の空白を削除しています。


Move Zeitwerk to railties

Active Support、railtiesの修正です。

Zeitwerkの依存をActive Supportからrailtiesに移動しています。Railsの挙動に関する処理はActive Supportよりもrailtiesにある方が適切な為。


Get rid of mattr_accessor in ActiveSupport::Dependencies

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

ActiveSupport::Dependenciesでattributeにmattr_accessorを使用していたのを、singleton_class.attr_accessorに修正しています。現在ActiveSupport::Dependenciesがincludeされる事はなく、 instance accessorsが不要になっている為。

rails commit log流し読み(2021/09/04)

2021/09/04分のコミットです。

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


Fixes typo

activesupport/lib/active_support/dependencies.rbのdocの修正です。

_eager_load_pathsのdoc内のタイポを修正しています。


Merge pull request #43158 from p8/guides/improve-configuring

rails guideのActive Job BasicsConfiguring Rails Applicationsの修正です。

auto-loading -> autoloadingに修正、及び、タイポや言い回しの修正を行っています。


Update the AS CHANGELOG

activesupport/CHANGELOG.mdの修正です。

classic autoloader削除に関連して行われたActiveSupport::Dependenciesの対応に関するエントリーを追加しています。


Formatting

activesupport/CHANGELOG.mdの修正です。

クラス名をクォートするよう修正しています。


Autoloading notes in the upgrading guide

rails guideのUpgrading Ruby on Railsの修正です。

autoloaderがzeitwerk modeだけになった対応、及び、その関連で行われた不要になったメソッドの削除等の対応についての説明を追加しています。


More examples in the autoloading guide

rails guideのAutoloading and Reloading Constantsの修正です。

各箇所の言い回しの修正、Rails内のclassへmoduleを追加する場合の対応方法についての説明の追加等を行っています。


Javascript generator option with choices (#43160)

railtiesの修正です。

rails newからwebpackオプションを削除し、代わりにJavaScriptに関する処理を指定する為のjavascriptオプションを追加しています。デフォルトはrails/importmap-railsで、importmap-rails以外に、webpack、及び、esbuild(rails/esbuild-rails)が指定出来るようになっています。