Created
October 26, 2016 16:06
-
-
Save yanmhlv/7b8f60b9d7531b5a79d2eb75cb031b44 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'active_record' | |
ActiveRecord::Base.establish_connection({ | |
adapter: 'postgres', # or mysql2 | |
host: 'localhost', | |
username: 'username', | |
password: 'password', | |
database: 'dbname', | |
}) | |
# ActiveRecord::Base.establish_connection("postgres://username:password@host/dbname") | |
class User < ActiveRecord::Base | |
self.table_name = "my_users" | |
self.primary_key = "id" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment