2023/01/11分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
delegate
now defines method with proper arity when delegating to a Class.HashWithIndifferentAccess#transform_keys
now takes a Hash argument, just as Ruby'sHash#transform_keys
does.
Merge pull request #46868 from amatsuda/Time.new_string
activemodel/lib/active_model/type/helpers/time_value.rb
の修正です。
ISO 8601と思われる文字列のTime
オブジェクトのパース処理を、Ruby 3.2以上の場合Ruby本体が提供しているメソッド(Time.new(string, in: "UTC")
)を使用するよう修正しています。
Ensure Dockerfile installs commonly needed packages (#46953)
railties/lib/rails/generators/app_base.rb
、
railties/lib/rails/generators/rails/app/templates/Dockerfile.tt
の修正です。
build-essential
、やgit
等、通常使用しそうと思われるパッケージをDockerfileでインストールするよう修正しています。
Merge pull request #46875 from amatsuda/delegate_to_class
Classに対してdelegate
を行う際に、適切な引数が指定されたメソッドをdelegateするClassに定義するよう修正しています。元々は...
argumentを使用してdelegate処理が行われていたのですが、これだとArray及びHashオブジェクトの生成が行われしまい、適切な引数が定義された状態の方が高速に処理が行える為。なお、引数がわからないとこの改善は行えない為、delegate
対象のメソッドがdelegate
の定義より前に行われている必要があります。
# 下記の書き方だと性能改善が効く class C def self.x() end delegate :x, to: :class end # `delegate`がメソッドの定義より前に行われている為、改善が効かない class C delegate :x, to: :class def self.x() end end
Clear metadata tables in tests instead of droping
Active Recordのテストの修正です。
metadata tablesをテスト実行時にdropせず、データの削除だけ行うよう修正しています。テストの順序によってはdrop後に参照出来ずエラーになってしまう為。
Let HWIA#transform_keys take a Hash argument like Hash#transform_keys
activesupport/lib/active_support/hash_with_indifferent_access.rb
の修正です。
`HashWithIndifferentAccess#transform_keys
の引数にHashを指定出来るよう修正しています。Hash#transform_keys
と挙動を合わせる為。
Edits to the autoloading guide
rails guideのAutoloading and Reloading Constants
の修正です。
autoloadに関する挙動の説明の言い回しを修正しています。
Document how to configure application classes for engines
rails guideのAutoloading and Reloading Constants
の修正です。
Autoloading When the Application Boots
の項に、engineのapplication classの設定を行う場合の方法についての説明を追加しています。
rails guideのAutoloading and Reloading Constants
の修正です。
先のコミットで追加した説明の言い回しの調整を行っています。
Use double quotes here, as per Rails own guidelines
rails guideのAutoloading and Reloading Constants
の修正です。
engineのapplication classの設定を行う場合のexampleコードで、Stringを定義するのにdouble quoteを使用するよう修正しています。Rails自体のguidelineと合わせる為。
activesupport/lib/active_support/environment_inquirer.rb
、
actionview/test/actionpack/controller/view_paths_test.rb
の修正です。
class_eval
を使用している箇所で、fname
及びlineno
引数を指定していない箇所があったのを指定するよう修正しています。スタックトレースなどの表示が正しく行われるようにする為。
Upgrade sdoc to support Ruby 3.2
Gemfile
の修正です。
sdoc
gemのバージョンを最新バージョン更新しています。