Skip to content

Commit 8227875

Browse files
authored
Merge pull request #968 from rsov/fix_nil_last_id
[AR52] Ability to handle nil last_inserted_id result
2 parents d1b97a6 + 16a4634 commit 8227875

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/arjdbc/db2/adapter.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,11 +753,10 @@ def reorg_table(table_name, name = nil)
753753

754754
# alias_method :execute_and_auto_confirm, :execute
755755

756-
# Returns the value of an identity column of the last *INSERT* statement
757-
# made over this connection.
756+
# Returns the value of an identity column of the last *INSERT* statement made over this connection.
758757
# @note Check the *IDENTITY_VAL_LOCAL* function for documentation.
759-
# @return [Fixnum]
760-
def last_insert_id
758+
# @return [Integer, NilClass]
759+
def last_inserted_id(result)
761760
@connection.identity_val_local
762761
end
763762

0 commit comments

Comments
 (0)