Remove extraneous array wrapping

We're already conditioning `reflection_fk` based on whether it's an
`Array` or not, so no need to wrap it in this `Array()` call since in
this block it is sure to be an `Array`.

Ref.: d7980c6b10
This commit is contained in:
Carlos Antonio da Silva 2024-05-07 09:54:05 -03:00
parent d7980c6b10
commit 59064f88d8
1 changed files with 0 additions and 1 deletions

View File

@ -127,7 +127,6 @@ module ActiveRecord
reflection_fk = reflection.foreign_key
if reflection_fk.is_a?(Array)
target_key_values = record ? Array(primary_key(record.class)).map { |key| record._read_attribute(key) } : []
reflection_fk = Array(reflection.foreign_key)
if force || reflection_fk.map { |fk| owner._read_attribute(fk) } != target_key_values
reflection_fk.each_with_index do |key, index|