title: Using find_or_create_by to create an object that includes a nested object
body: <p>I imagine a query like this. </p>
  
  <pre><code>Movie.find_or_create_by_title(title: 'foo').photos.find_or_create_by_name(name: 'bar')
  </code></pre>
  
  <p>The given query will create the <code>Photo</code> object but will not consider its parent <code>Movie</code>. </p>
  
  <pre><code> =&gt; #&lt;Photo id: 3, movie_id: nil …
  </code></pre>
  
  <p>Is there any way I can pass the movie to it?</p>
  
  <p>Update: The reason I try to "save both at once" is because I have a validation in place that requires a Movie to have at least one photo. See: <a href="https://stackoverflow.com/a/12962317/471313">https://stackoverflow.com/a/12962317/471313</a></p>