Skip to content

Commit

Permalink
Make insert return an array, and include the id_value if super return…
Browse files Browse the repository at this point in the history
…s nil

The super is not returning the id_value if it is available (as it used
to). Furthermore ActiveRecord::Persistence#_create_record expects an
array of values.
  • Loading branch information
andynu committed Apr 1, 2024
1 parent b7e9b6f commit ffc39e0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def sql_for_insert(sql, pk, binds)

def insert(arel, name = nil, pk = nil, id_value = nil, sequence_name = nil, binds = [])
pk = nil if id_value
super
Array(super || id_value)
end

# New method in ActiveRecord 3.1
Expand Down

0 comments on commit ffc39e0

Please sign in to comment.