Skip to content

Instantly share code, notes, and snippets.

@billie66
Last active August 29, 2015 14:20
Show Gist options
  • Save billie66/0dcb9d6491314b165967 to your computer and use it in GitHub Desktop.
Save billie66/0dcb9d6491314b165967 to your computer and use it in GitHub Desktop.
# encoding: UTF-8
namespace :db do
desc "import some data to the users table"
task :users => :environment do
a = []
File.open("lib/tasks/talk_production.sql", 'r') do |f|
a = f.read.strip.split(/\n/)
end
a.delete_at(0)
a.each do |e|
u = User.new
info = e.gsub(/\'/, '').split(',')
u.name = info.delete_at(1)
u.email = info.delete_at(2)
#u.password_digest = info.delete_at(3)
u.token = info.delete_at(4)
u.save
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment