2024/01/05分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Set
config.action_view.annotate_rendered_view_with_filenames
totrue
in the development environment.
- Rename
ActionView::TestCase::Behavior::{Content,RenderedViewContent}
- Parse
ActionView::TestCase#rendered
HTML content asNokogiri::XML::DocumentFragment
instead ofNokogiri::XML::Document
] - Add the
nonce: true
option forstylesheet_link_tag
helper to support automatic nonce generation for Content Security Policy.
actioncable/CHANGELOG.md
activesupport/test/core_ext/object/json_gem_encoding_test.rb
の修正です。
テスト用のrequire_or_skip
メソッドでrequire
処理を誤って削除してしまっていたのを修正しています。
Remove MethodCallAssertions
Ruby 2.7 work-around
activesupport/lib/active_support/testing/method_call_assertions.rb
の修正です。
MethodCallAssertions
内にあるRuby 2.7向けのwork-around処理を削除しています。
Merge pull request #50412 from fatkodima/fix-find_by-for-cpks
activerecord/lib/active_record/core.rb
の修正です。
find_by
にcomposite primary keysを使用しているassociationのinstanceを指定した場合に結果が正しく取得出来ないバグがあったのを修正しています。
Merge pull request #50337 from Edouard-chin/ec-log-level
railties/lib/rails/application/bootstrap.rb
、
railties/lib/rails/application/configuration.rb
の修正です。
Broadcast Loggerを使用した場合に、config.log_level
の設定が無視されてしまうバグがあったのを修正しています。
Add CI service files to dockerignore template
railties/lib/rails/generators/rails/app/templates/dockerignore.tt
の修正です。
CI関連のファイルをdockerignore
に指定するよう修正しています。
default annotate_rendered_view_with_filenames to true in development
railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
の修正です。
rails new
で新規にアプリを作成した場合に、デフォルトでconfig.action_view.annotate_rendered_view_with_filenames
にtrueを指定するよう修正しています。
Rename ActionView::TestCase::Behavior::{Content,RenderedViewContent}
actionview/lib/action_view/test_case.rb
の修正です。
ActionView::TestCase::Behavior::Content
をActionView::TestCase::Behavior::RenderedViewContent
にリネームしています。
アプリ側でContent
というクラスが定義されていた場合に、クラス名のコンフリクトによりActionView::TestCase::Behavior
側の処理が正しく行えない、という問題があり、コンフリしなさそうな名前に変更しています。
Add assertions for stopped ActionCable streams
actioncable/lib/action_cable/channel/test_case.rb
の修正です。
特定のstreamが開始していないことを確認するためのassert_not_has_stream
、及び、modelに対する特定のsteamが開始していないことを確認するためのassert_not_has_stream_for
assertionsを追加しています。
Parse ActionView::TestCase#rendered
as DocumentFragment
actionview/lib/action_view/test_case.rb
の修正です。
ActionView::TestCase#rendered
でHTML contentをNokogiri::XML::Document
としてパースしていたのを、Nokogiri::XML::DocumentFragment
としてパースするよう修正しています。partialをrenderする際など、完全なHTMLでなく特定のDOM部分だけをパースすることは通常発生するケースで、そのような場合に不要なルートのhtml
タグなどを生成しないようにするため。
Merge pull request #50464 from vlado/round_mode_missing_mode
actionview/lib/action_view/helpers/number_helper.rb
のdocの修正です。
number_to_phone
等のnumber_xxx
系のhelperメソッドのdocに:round_mode
オプションについての説明を追加しています。
Merge pull request #50482 from p8/activerecord/explain-proxy
activerecord/lib/active_record/relation.rb
の修正です。
last
、pluck
やcount
等のメソッドに対してexplain
を指定出来るよう修正しています。
User.all.explain.count # => EXPLAIN SELECT COUNT(*) FROM `users` User.all.explain.maximum(:id) # => EXPLAIN SELECT MAX(`users`.`id`) FROM `users`
Don't assume the page language is English
railties/lib/rails/templates/layouts/application.html.erb
の修正です。
Railsが内部で使用するlayoutファイルでlang
にen
が指定されていたのを削除しています。ユーザのlangがen
でない可能性があり、誤っている可能性があるlangは定義しない方が良いため。
docs: update reference to main
branch
rails guideのRails Internationalization (I18n) API
の修正です。
https://github.com/rack/rack-contribのデフォルトのブランチ名を最新の内容に更新しています。
Use rubocop github formatter on CI to display annotations in the UI
railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt
の修正です。
CIでRubocopを実行する際にgithub formatterを使用するよう修正しています。GitHubのUIでannotationとして結果が表示されるようにする為。
Remove ActionView::Renderer#render_template
actionview/lib/action_view/renderer/renderer.rb
の修正です。
使用していないActionView::Renderer#render_template
メソッドを削除しています。
Rename #assert_not_has_stream
#assert_has_no_stream
actioncable/lib/action_cable/channel/test_case.rb
の修正です。
assert_not_has_stream
をassert_has_no_streamに、
assert_not_has_stream_forを
assert_has_no_stream_for`にそれぞれリネームしています。
Remove workaround for Ruby 2.7 at ActiveSupport::Cache#lookup_store
activesupport/lib/active_support/cache.rb
の修正です。
ActiveSupport::Cache#lookup_store
メソッドからRuby 2.7向けの処理を削除しています。
Add the nonce: true option for stylesheet_link_tag helper
actionview/lib/action_view/helpers/asset_tag_helper.rb
の修正です。
stylesheet_link_tag
にContent Security Policyのnonceを付与する為のnonce: true
オプションを指定出来るよう修正しています。javascript_include_tag nonce: true
と同じ振る舞い。
Add Naming and Pronouns headings to API wording guide [ci-skip]
rails guideのAPI Documentation Guidelines
の修正です。
Wording
セクション内の説明に見出しを追加しています。
Add "GOOD" and "BAD" examples to API wording guide [ci-skip]
rails guideのAPI Documentation Guidelines
の修正です。
Wording
セクション内の説明に、コメントやメソッドのexampleの、良い例と悪い例の説明を追加しています。
Cleanup usage of ruby2_keywords
Ruby 2.7をサポートしない事により不要になった、ruby2_keywords
の呼び出し処理を削除しています。
Name all supported methods in explain
CHANGELOG entry
activerecord/CHANGELOG.md
の修正です。
last
、pluck
やcount
等のメソッドに対してexplain
を指定出来るよう修正した、Name all supported methods in explain CHANGELOG entryのエントリーに、explain
を指定出来るようになったメソッドを全て記載するよう修正しています。
Ruby 2.7をサポートしない事により不要になった、defined?
を使用してのインスタンス変数が定義済みかどうかのチェックを削除しています。
Merge pull request #50301 from p8/guides/ror-security-links
rails guideのSecuring Rails Applications
の修正です。
もうメンテされていないgemや、古いRails向けの説明など、内容が古くなっている箇所を削除しています。
Merge pull request #50342 from JohnAnon9771/doc/improve-controlling-association-scope
rails guideのActive Record Associations
の修正です。
Controlling Association Scope
セクションに、ディレクトリ構造とscopeの関連がわかるexampleを追加しています。