• Heinrich Lee Yu's avatar
    Fix invalid DB checks · 9c33b79d
    Heinrich Lee Yu authored
    We should not use `ActiveRecord::Base.connected?` to
    check if a DB exists because that only checks if a
    connection is already established. It's possible
    for the DB to exist but a connection has not yet
    been established.
    
    I noticed that this method in the initializer was
    wrong but we didn't notice it because this method
    was never invoked.
    
    0_license.rb is run before any connections are
    established so `connected?` always returned false
    even if the table exists.
    
    I've also fixed other places that use the same check
    even though they might not be having problems because
    a connection is already established at that point.
    9c33b79d
license_helper_spec.rb 4.47 KB