Update partitioned relations to use ActiveRecord options
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
In !130073 (merged) we have defined partitioned relations as:
has_many :statuses, ->(pipeline) { in_partition(pipeline) }, class_name: 'CommitStatus', foreign_key: :commit_id, partition_foreign_key: :partition_id, inverse_of: :pipeline
But Rails 7.1 added a way to specify composite foreign keys on a relation:
has_many :statuses, class_name: 'CommitStatus', foreign_key: [:commit_id, :partition_id], primary_key: [:id, :partition_id], inverse_of: :pipeline
We should update these relations after upgrading to Rails 7.1: &11470
Edited by Marius Bobin