Guest User

Untitled

a guest
Mar 5th, 2018
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #!/usr/bin/ruby
  2. #Script used to add base TAG data
  3.  
  4. require 'rubygems'
  5. require_gem 'activerecord'
  6. require 'faster_csv'
  7.  
  8. ActiveRecord::Base.establish_connection(
  9. :adapter => "oci",
  10. :host => "192.189.31.79/xe",
  11. :username => "prep",
  12. :password => "prep"
  13. )
  14.  
  15. class Callerdescription < ActiveRecord::Base
  16. set_table_name "pco_callerdescription"
  17. end
  18.  
  19. cnt = 1
  20. puts "Beginning to process..."
  21. #First get the Senate members
  22. FasterCSV.foreach('Extlist.csv') do | row |
  23. if cnt > 1
  24. if row[2] != nil
  25. description = Callerdescription.new
  26. description.callernumber = row[0]
  27. description.description = row[1]
  28. description.save
  29. end
  30. end
  31. cnt += 1
  32. end
  33.  
  34. puts "#{cnt} records processed..."
Add Comment
Please, Sign In to add comment