Class: Arql::Connection
Class Method Summary collapse
Class Method Details
.open(options) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/arql/connection.rb', line 4 def open() print "Establishing DB connection to #{[:host]}:#{[:port]}" ActiveRecord::Base.establish_connection() print "\u001b[2K" puts "\rDB connection to #{[:host]}:#{[:port]} established\n" $C = ActiveRecord::Base.connection $C.define_singleton_method(:dump) do |filename, no_create_db=false| Arql::Mysqldump.new.dump_database(filename, no_create_db) end end |