Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement