Created
July 13, 2016 17:24
-
-
Save georgeu2000/034a8de58402ac33436aa1c967f4eac7 to your computer and use it in GitHub Desktop.
How to connect to Postgres DB with Active Record without Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db_config = YAML.load( ERB.new( File.read( "config/postgres.yml" )).result ) | |
ActiveRecord::Base.establish_connection( db_config[ ENV[ 'RACK_ENV' ]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment