Skip to content

Instantly share code, notes, and snippets.

@paulcsmith
Last active Jun 18, 2020
Embed
What would you like to do?
AppDatabase.transaction do
SaveParent.create!(params) # Save Parent like normal since parent params are at top-level
children = params.from_json["parent"]["children"].as_a.each do |child|
SaveChild.create!(name: child["name"].as_s)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment