This commit is contained in:
Matt Langlois 2019-08-05 19:00:40 -07:00
Родитель 1a5789b560
Коммит 28d00e8fed
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 0472F74D7368B36B
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -306,15 +306,15 @@ module GitHub
)
SQL
if sql.last_insert_id == 0
# No inert took place nor did any update occur. This means that
# the value was not an integer thus not incremented.
raise InvalidValueError
elsif sql.affected_rows == 1
if sql.affected_rows == 1
# If the number of affected_rows is 1 then a new value was inserted
# thus we can just return the amount given to us since that is the
# value at the key
amount
elsif sql.last_insert_id == 0
# No inert took place nor did any update occur. This means that
# the value was not an integer thus not incremented.
raise InvalidValueError
else
# This last condidition only occurs when:
# 1. An insert did NOT occur