# YAML and has many associations

**URL:** <https://www.ruby-forum.com/t/yaml-and-has-many-associations/54018>\
**Category:** Rails\
**Created:** [February 20, 2006, 5:58pm UTC](https://www.ruby-forum.com/t/yaml-and-has-many-associations/54018 "2006-02-20T17:58:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 20, 2006, 5:58pm UTC](https://www.ruby-forum.com/t/yaml-and-has-many-associations/54018/1 "2006-02-20T17:58:14Z")

</div>

Hi,

I have the following:

order = YAML::load(order\_yaml)

The YAML contains order\_items too, and my order model has a has\_many to  
order\_items.

When I do order.order\_items, I don’t want Rails to go the db to get the  
order\_items, but use the order\_items already contained in the object  
created from the YAML.

How would I do this?

Thanks  
Joerg
