なるようになるブログ

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

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

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

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

actionview/CHANGELOG.md

activesupport/CHANGELOG.md


Implement CurrentAttributes#set in terms of Object#with

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

CurrentAttributes#setの実装をObject#withdelegateするだけに修正しています。CurrentAttributes#setでやりたい事はObject#withを呼び出すだけで実現出来るようになっている為。


Remove redundant version constraint on mail gem

actionmailer/actionmailer.gemspecの修正です。

mail gemのバージョン指定から不要なバージョン制約部分を削除しています。


Don't use the Gemfile lock on CI steps

github/workflowsの修正です。

CIで処理を実行する際に、Gemfile.lockを削除しています。最新のgemで処理を実行するよにする為。


Remove the Gemfile.lock for good now

github/workflowsの修正です。

先のGemfile.lockの削除処理でファイル名の指定が誤っていたのを修正しています。


Fix typo in ActiveRecord::Core.configurations doc [ci-skip]

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

ActiveRecord::Core.configurationsのdocのグラマーの修正を行っています。


Add code examples to readonly documentation

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

ActiveRecord::Core.readonly!のdocにexampleコードを追加しています。


Raise ArgumentError if :renderable object does not respond to #render_in

actionview/lib/action_view/renderer/abstract_renderer.rbactionview/lib/action_view/template/renderable.rbの修正です。

:renderableオプションに、#render_inメソッドが実装されていないオブジェクトが指定された場合にArgumentErrorをraiseするよう修正しています。


Simplify CurrentAttribute.instance delegation

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

CurrentAttribute.instanceのdelegation処理を、Module.delegateを使用するようリファクタリングしています。


Relock Gemfile on Ruby 3.3.0

Gemfile.lockの修正です。

Ruby 3.3.0の環境でGemfile.lockを更新しています。google-protobufRuby 3.3.0向けのprecompile binariesがまだリリースされておらず、google-protobufの特定のOS向けの指定が入っているとエラーになってしまうため。


Document developer-facing change to config.action_dispatch.show_exceptions default

rails guideの修正です。

config.action_dispatch.show_exceptionsについての詳細な説明、及び、Rails 7.1で行われた挙動の変更の詳細についての説明を追加しています。


Merge pull request #50675 from gareth/remove-redundant-restricted-class-method

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

使用出来ないclass methodの一覧からparentを削除しています。元々はModule#parentというメソッドをRails内部で保持しているから使用出来ないようにしていたのですが、左記メソッドはRemove deprecated Module#parent_name, Module#parent and `Module#p…で削除されており、現在は使用出来る様になっているため。


Merge pull request #50674 from p8/activerecord/document-sum-with-block

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

Calculations#count及びCalculations#sumメソッドのdocに、blockを指定した場合の挙動の説明を追加しています。


Add default: support for ActiveSupport::CurrentAttributes.attribute

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

ActiveSupport::CurrentAttributes.attributeにデフォルト値を指定出来るよう修正しています。

class Current < ActiveSupport::CurrentAttributes
  attribute :counter, default: 0
end

Ignore docker and git related files in dockerignore

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

Docker及びgit関連のファイルをdockerignoreに追加しています。


Merge pull request #50664 from ghiculescu/global_executor_concurrency-example

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

config.active_record.global_executor_concurrency config内の、global_executor_concurrencyとpool size関連について説明している箇所に、具体的な値を設定した場合の例を追加しています。


Avoid definition of methods in CurrentAttributes at runtime

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

CurrentAttributesmethod_missingで定義されていないメソッドが呼びだされた場合に、実行時にdelegateの定義をしていたのを、method_addedを使用してメソッド追加時にdelegateの定義を行えるよう修正しています。```でメソッドの定義をするのは実行効率が良くない為。


Update the default Puma configuration

railties/lib/rails/generators/rails/app/templates/config/puma.rb.ttの修正です。

Pumaのデフォルトの設定ファイルを更新しています。一番の変更ポイントはthreadのデフォルト値の変更で、元々は5だったのが3に変更になっています。これは色々とベンチマークとその結果について議論した結果、5は多すぎで3がデフォルトとしては最善なのでは、ということになり変更されています。ベンチマークや議論については、Set a new default for the Puma thread countにまとまっていますので、興味がある方はそちらをご参照ください。


Remove ActiveRecord::AttributeAssignment#assign_nested_parameter_attributes

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

現在は不要になっているActiveRecord::AttributeAssignment#assign_nested_parameter_attributesメソッドを削除しています。