Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. require 'pg'
  2. require 'active_record'
  3.  
  4.  
  5. = File.open('teste.txt')
  6. f_lines = f.read.split(";")
  7.  
  8. conn = ActiveRecord::Base.establish_connection(:adapter => 'postgresql',
  9. :username => 'root',
  10. :password => "123",
  11. :host => "127.0.0.1",
  12. :database => "db")
  13.  
  14. #query = "insert into students (name, registration, room, password) values "+ vetor[]
  15. #simulated = ActiveRecord::Base.connection.execute(query)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement