I tried to use ruby-mysql with ActiveRecord (not the new version, but it seems the last one suffers from the same problem), and I got an error about Nil class doesn't respond to zero?.
The calling code in question looks like this:
def active?
...
if @connection.respond_to?(:errno)
@connection.errno.zero?
else
true
end
end
Therefore, I suggest changing Mysql#errno to this:
def errno
@last_error && @last_error.errno || 0
end
I tried to use ruby-mysql with ActiveRecord (not the new version, but it seems the last one suffers from the same problem), and I got an error about Nil class doesn't respond to zero?.
The calling code in question looks like this:
Therefore, I suggest changing Mysql#errno to this: def errno @last_error && @last_error.errno || 0 end