title: How can I load some ActiveRecord models from a YAML file and save them to the DB?
body: <p>I'm trying to save some lookup table data out to a YAML file so that later when I need to set up my app on a different machine I can load the data in as seed data.</p>
  
  <p>The data is stuff like select options, and it's pretty much set, so no worries about the live data changing between serializing and deserializing.</p>
  
  <p>I have output the data like this...</p>
  
  <pre><code>file = File.open("#{RAILS_ROOT}/lib/tasks/questions/questions.yml", 'w')
  questions = Question.find(:all, :order =&gt; 'order_position')
  file &lt;&lt; YAML::dump(questions)
  file.close()
  </code></pre>
  
  <p>And I can load the file like this...</p>
  
  <pre><code>questions = YAML.load_file('lib/tasks/questions/questions.yml')
  </code></pre>
  
  <p>However, when I try to save a question I get this error...</p>
  
  <pre><code>&gt;&gt; questions[0].save
  NoMethodError: undefined method `save' for #&lt;YAML::Object:0x2226b84&gt;
  </code></pre>
  
  <p>What is the correct way to do this?</p>