Skip to content

Commit 59064f8

Browse files
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.: d7980c6
1 parent d7980c6 commit 59064f8

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

activerecord/lib/active_record/associations/belongs_to_association.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ def replace_keys(record, force: false)
127127
reflection_fk = reflection.foreign_key
128128
if reflection_fk.is_a?(Array)
129129
target_key_values = record ? Array(primary_key(record.class)).map { |key| record._read_attribute(key) } : []
130-
reflection_fk = Array(reflection.foreign_key)
131130

132131
if force || reflection_fk.map { |fk| owner._read_attribute(fk) } != target_key_values
133132
reflection_fk.each_with_index do |key, index|

0 commit comments

Comments
 (0)