establish_connection(spec = nil)
Instance Public methods
Establishes the connection to the database. Accepts a hash as input where
the :adapter key must be specified with the name of a database
adapter (in lower-case) example for regular databases (MySQL, Postgresql,
etc):
ActiveRecord::Base.establish_connection(
adapter: "mysql",
host: "localhost",
username: "myuser",
password: "mypass",
database: "somedatabase"
)
Example for SQLite database:
ActiveRecord::Base.est