なるようになるブログ

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

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

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

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


[skip ci] Document tuple support in Active Record where clauses

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

ActiveRecord::QueryMethods#whereメソッドのdocに、Introduce query-by-tuple syntaxで追加されたtuple syntaxを舌用した場合のexampleを追加ししています。


[skip ci] Add composite primary key examples to Rails guides

rails guideの修正です。

controllerやformでcomposite primary keyを使用しているmodelを扱う場合の説明を追加しています。


Infer primary_key: :id on associations with composite primary key models

activerecord/lib/active_record/autosave_association.rbactiverecord/lib/active_record/reflection.rbの修正です。

composite primary keyを使用しているmodelでassociationを定義する際、必ずprimary_key、または、query_constraintsオプションを指定する必要があったのを、composite primary keyにidが含まれている場合、自動でprimary_keyを推測出来るよう修正しています。これにより、

class Order
  self.primary_key = [:shop_id, :id]

  has_many :order_agreements, primary_key :id
end

class OrderAgreement
  belongs_to :order, primary_key: :id
end

と記載する必要があったのをが、

class Order
  self.primary_key = [:shop_id, :id]

  has_many :order_agreements
end

class OrderAgreement
  belongs_to :order
end

のように、primary_keyオプションを省略出来るようになっています。


Revert "Lock globalid gem version to address broken CI"

globalid gemのバージョンをロックした、Lock globalid gem version to address broken CIをRevertしています。元々あった問題が解消された新しいバージョンのglobalidがリリースされた為。


Document clean chain behavior for ActiveRecord scope

rails guideのActive Record Query Interfaceの修正です。

scopeをchainした場合の挙動について説明した、New Chains Inside Scope Blockを追加してます。


[ci skip] Document query_constraints option in associations

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

associationのドキュメントにquery_constraintsオプションについての説明を追加しています。


Merge pull request #49145 from javierav/feature/assets-config

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

asset pipeline libraryにPropshaftを使用している場合に、Sprockets用の設定を生成しないよう修正しています。


Instruct contributors to use 'ci skip' when submitting doc changes

rails guideのContributing to Ruby on Railsの修正です。

Contributing to the Rails Documentationの項に、docの変更の場合、PRタイトルに[ci skip]を指定してほしい旨説明を追加しています。


Load ambient fixtures for ActiveRecordMessagePackTest

activerecord/test/cases/message_pack_test.rbの修正です。

テスト内で使用しているfixtureのロードが不足していたのを修正しています。


Remove unused fixtures in *ConnectionTest

activerecord/test/cases/adapters/abstract_mysql_adapter/connection_test.rbactiverecord/test/cases/adapters/postgresql/connection_test.rbの修正です。

使用していないfixtureを削除しています。


Merge pull request #49118 from akhilgkrishnan/generate-token-for-release-note

rails guideのRuby on Rails 7.1 Release Notesの修正です。

ActiveRecord::Base.generates_token_forメソッドについての詳細な説明を追加しています。


Merge pull request #49152 from yahonda/bigdecimal_314_or_higher_will_be_installed

activerecord/test/cases/validations/numericality_validation_test.rbの修正です。

NumericalityValidationTestで古いBigDecimal向けのテストがあったのを削除しています。Active Supportの依存上、現在Railsと一緒に使われることは無いバージョンの為。


Fix indentation in 7.1 release notes

rails guideのRuby on Rails 7.1 Release Notesの修正です。

ActiveRecord::Base.generates_token_forメソッドのexampleコードのインデントを修正しています。


[skip ci] ActiveSupport deprecate changes added to 7.1 release note (#49119)

rails guideのRuby on Rails 7.1 Release Notesの修正です。

Active SupportのDeprecationsの項にdeprecatedになったメソッドの説明を追加しています。


Remove "proc to update web drivers." [ci-skip]

actionpack/lib/action_dispatch/system_testing/browser.rbのdocの修正です。

Omit webdrivers gem from Gemfile templateの修正でActionDispatch::SystemTesting::Browser#preloadメソッドのdocを修正した際に、文を中途半端に削除してしまっていたのを、中途半端に残ってしまっていた説明部分を削除しています。


Bump github actions/checkout to v4

GitHub Actionsの修正です。

actions/checkoutのバージョンをv4に更新しています。