{"id":359,"date":"2007-10-21T14:26:44","date_gmt":"2007-10-21T18:26:44","guid":{"rendered":"http:\/\/auroralux.net\/blog\/2007\/10\/21\/loading-data-model-with-fixtures-in-rails\/"},"modified":"2007-10-21T15:06:35","modified_gmt":"2007-10-21T19:06:35","slug":"loading-data-model-with-fixtures-in-rails","status":"publish","type":"post","link":"https:\/\/fhmiv.net\/blog\/2007\/10\/21\/loading-data-model-with-fixtures-in-rails\/","title":{"rendered":"Loading data model with Fixtures in Rails"},"content":{"rendered":"<p>I&#8217;m putting together a smallish data model in Rails. Some of my data is pre-existing, including a bunch of Items, some of which have SubItems. I found some hints on how to represent the initial data with YAML and to piggy-back on the Fixture functionality to load it in a migration, all from <a href=\"http:\/\/www.amazon.com\/gp\/product\/0977616630?ie=UTF8&#038;tag=framcp-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0977616630\">Agile Web Development with Rails<\/a><img loading=\"lazy\" src=\"http:\/\/www.assoc-amazon.com\/e\/ir?t=framcp-20&#038;l=as2&#038;o=1&#038;a=0977616630\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\"\/>. <\/p>\n<p>The <a href=\"http:\/\/groups.google.com\/group\/rubyonrails-talk\/browse_thread\/thread\/2b242bd0ee4238e9\/f2fda1f4be0aa263?lnk=gst&#038;q=loading+initial+data#f2fda1f4be0aa263\">mailing list pointed out<\/a> I can use Ruby calls in the YAML mark-up to build the relationships.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m putting together a smallish data model in Rails. Some of my data is pre-existing, including a bunch of Items, some of which have SubItems. I found some hints on how to represent the initial data with YAML and to &hellip; <a href=\"https:\/\/fhmiv.net\/blog\/2007\/10\/21\/loading-data-model-with-fixtures-in-rails\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[11],"_links":{"self":[{"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/posts\/359"}],"collection":[{"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/comments?post=359"}],"version-history":[{"count":0,"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/posts\/359\/revisions"}],"wp:attachment":[{"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/media?parent=359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/categories?post=359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/tags?post=359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}