Posted By

andyh on 10/18/06


Tagged

data rails ruby migration


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


Create data during migration


 / Published in: Ruby
 

  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  

You need to login to post a comment.