2022/09/02分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activesupport/CHANGELOG.md
activerecord/CHANGELOG.md
Update stackprof
Gemfile.lock
の修正です。
stackprof
gemを最新バージョンに更新しています。
Avoid using Module#<= in value_for
activerecord/lib/active_record/scoping.rb
の修正です。
value_for
メソッドでscope typeを取得するのにModule#<=
を使用しないようリファクタリングしています。性能改善対応。
Support thread_mattr_accessor in anonymous classes
activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb
の修正です。
anonymous classでthread_mattr_accessor
を使用出来るよう修正しています。
Formatting typo
rails guideのActive Record Validations
の修正です。
ページ内リンクが動作するようdocのフォーマットの修正を行っています。
Merge pull request #45917 from jonathanhefner/redirect_action_dispatch-payload-include-request
actionpack/lib/action_dispatch/routing/redirection.rb
の修正です。
redirect.action_dispatch
payloadにrequest
オブジェクトを追加しています。redirect_to.action_controller
と同じpayloadになるようにする為。
Freeze thread_mattr_accessor default values
activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb
の修正です。
thread_mattr_accessor
のdefault
valueをfreezeするよう修正しています。複数のスレッドでアクセスする値のため、動的に変更されてしまうのを防ぐため。
Avoid using render(...) and return
in example code
actionpack/lib/abstract_controller/rendering.rb
、rails guideのLayouts and Rendering in Rails
の修正です。
doc及びDoubleRenderError
classで使用するエラーメッセージで、renderやredirectするのにxx and return
という処理(e.g. redirect_to(...) and return
)があったのを、and
を使わない(複数行で只のreturnを使用)に修正しています。初心者が見た時にわかりづらいコードであり、避けた方が良いだろう、という事で修正されています。
Merge pull request #45923 from compeak/main
activestorage/db/migrate/20170806125915_create_active_storage_tables.rb
の修正です。
Active Storageが生成するmigrationファイルのRailsのバージョンを7.0
に更新しています。
Merge pull request #45911 from fatkodima/invalid-range-disk-controller
activestorage/app/controllers/concerns/active_storage/file_server.rb
の修正です。
partial downloadに不正なRangeを指定した場合に、responseのHTTP statusが404になってしまっていたのを、416(Range Not Satisfiable)になるよう修正しています。
Add missing documentation for Rails.error
railties/lib/rails.rb
のdocの修正です。
Rails.error
にdocを追加しています。
Allow AR::QueryMethods#select to accept a hash
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
ActiveRecord::QueryMethods#select
にtable名 + columnsまたはaliasesをHashで指定出来るよう修正しています。
Post.joins(:comments).select(posts: [:id, :title, :created_at], comments: [:id, :body, :author_id])
Post.joins(:comments).select(posts: { id: :post_id, title: :post_title }, comments: { id: :comment_id, body: :comment_body })
Fix ActiveRecord::FinderMethods.find
when passing multiple ids and primary key is not selected
activerecord/lib/active_record/relation/finder_methods.rb
の修正です。
ActiveRecord::FinderMethods.find
に複数idを指定 + primary keyが未指定の場合に結果が取得出来ないバグがあったのを修正しています。
Do not mutate relation when implicitly selecting a primary key in ActiveRecord.find
activerecord/lib/active_record/relation/finder_methods.rb
の修正です。
先のfind
の修正で暗黙的にRelationの状態を変更していた(primary keyを設定していた)のを、Relationの状態は変更しないよう修正しています。