Add `ActiveRecord::Relation#extract_associated` for extracting associated record
#35784

dhh wants to merge extract-associated into master

We do not currently have an analysis of these two commits