Skip to content

Commit fcf115a

Browse files
committed
Merge branch 'merging_branch' of https://github.com/rsov/activerecord-jdbc-adapter into merging_branch
2 parents 40f6558 + 6ee9486 commit fcf115a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/arjdbc/jdbc/adapter.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ def update_lob_value(record, column, value)
358358
# @return [Integer, NilClass]
359359
def last_inserted_id(result)
360360
if result.is_a?(Hash) || result.is_a?(ActiveRecord::Result)
361+
# If table does not have primary key defined
362+
return nil if result.first.blank?
363+
364+
361365
result.first.first[1] # .first = { "id"=>1 } .first = [ "id", 1 ]
362366
else
363367
result

0 commit comments

Comments
 (0)