I am generating data which is to be stored in rails. I have exported the data as a serialized JSON string.

How can I automatically build a new object *and its child associations* from this string? `Model.new(json_string)` throws an error because the children are hashes and not initialized. Is the only option to loop through each object and initialize the children? I feel like there might be some magic I'm not aware of here.

Example:

```
Child belongs_to :parent
Parent has_many :children

json_string = "{
  attribute1:"foo", 
  attribute2:"bar",
  children: [
    {attribute1:"foo"},
    {attribute1:"foo"}
    ]}"

Parent.new(json_string)

ActiveRecord::AssociationTypeMismatch: Child(#79652130) expected, got Hash(#69570820)

```

Is there a way to initialize new children from my serialized object automatically? The real problem includes three child levels.