Skip to content

Instantly share code, notes, and snippets.

@jasonm23
Created May 18, 2010 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonm23/404631 to your computer and use it in GitHub Desktop.
Save jasonm23/404631 to your computer and use it in GitHub Desktop.
configId = Configuration.find(:first).id
c = Configuration.create Configuration.find(:first).attributes
klasses = [Menu, Translation, BookingMarketName, CornerMarketName, ScoreMarketName, Service, AllowDomain]
klasses.each { |klass|
klass.find(:all, :conditions => { :configuration_id => configId } ).each { |item|
o = klass.create item.attributes
o.configuration_id = c.id
o.update
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment