Create data during migration


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # e.g. Copy existing data from users table to newly created members table
  2. userMove = User.find(:all)
  3. userMove.each do |t|
  4. Member.create :first_name => t.forename,
  5. :last_name => t.surname,
  6. :email => t.email,
  7. :password => t.password
  8. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.