Forum: Ruby on Rails YAML and has many associations

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joerg D. (Guest)
on 2006-02-20 18:58
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
This topic is locked and can not be replied to.