Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. require 'active_record'
  2.  
  3. ActiveRecord::Base.establish_connection({
  4. adapter: 'postgres', # or mysql2
  5. host: 'localhost',
  6. username: 'username',
  7. password: 'password',
  8. database: 'dbname',
  9. })
  10. # ActiveRecord::Base.establish_connection("postgres://username:password@host/dbname")
  11.  
  12. class User < ActiveRecord::Base
  13. self.table_name = "my_users"
  14. self.primary_key = "id"
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement