Class: ActiveRecord::DbExists::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/active_record/db_exists/railtie.rb

Instance Method Summary collapse

Instance Method Details

#database_exists?Boolean

Returns:

  • (Boolean)


15
16
17
18
19
20
21
# File 'lib/active_record/db_exists/railtie.rb', line 15

def database_exists?
  ActiveRecord::Base.connection
rescue ActiveRecord::NoDatabaseError
  false
else
  true
end