• D
    activerecord/mysql2: Avoid setting @connection to nil, just close it · 01adc456
    Dylan Thacker-Smith 提交于
    By doing `@connection = nil` that means that we need nil checks before it
    is used anywhere, but we weren't doing those checks.  Instead, we get a
    NoMethodError after using a connection after it fails to reconnect.
    
    Neither of the other adapters set @connection to nil, just the mysql2
    adapter. By just closing it, we avoid the need to check if we have a
    connection object and it will produce an appropriate exception when used.
    01adc456
database_statements.rb 3.6 KB