title: find_or_create_by_field1_and_field2 not working as expected
body: <p>I have an application with some existing categories and want to add more categories to it. As there are quote a few additional categories I thought I'd add this to a seed file.</p>
  
  <p>I don't want to overwrite any existing categories so I'm using the find_or_create method to add a <code>:name</code> and <code>:category_parent_id</code> based on this question.</p>
  
  <p><a href="https://stackoverflow.com/questions/3046607/rails-find-or-create-by-more-than-one-attribute">Rails find_or_create by more than one attribute?</a></p>
  
  <p>So I added the following to my seed file</p>
  
  <pre><code>categories = Category.find_or_create_by_name_and_category_parent_id(
    {name: "TV", category_parent_id: 2},
    {name: "Oven", category_parent_id: 2},
    {name: "Fridge", category_parent_id: 2},
    {name: "Microwave", category_parent_id: 2},
    {name: "Toaster", category_parent_id: 2}
  )
  </code></pre>
  
  <p>The output I get if I run this in the console when no matching entries in the categories table is as follows</p>
  
  <pre><code>Category Load (0.5ms)  SELECT "categories".* FROM "categories" WHERE "categories"."name" = 'Microwave' AND "categories"."category_parent_id" = 2 LIMIT 1
     (0.3ms)  BEGIN
    Category Exists (0.6ms)  SELECT 1 AS one FROM "categories" WHERE "categories"."name" = 'Microwave' LIMIT 1
    SQL (18.8ms)  INSERT INTO "categories" ("category_parent_id", "category_type", "created_at", "name", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["category_parent_id", 2], ["category_type", nil], ["created_at", Fri, 15 Mar 2013 14:41:53 EST +11:00], ["name", "Microwave"], ["updated_at", Fri, 15 Mar 2013 14:41:53 EST +11:00]]
     (0.8ms)  COMMIT
   =&gt; #&lt;Category id: 31, name: "Microwave", created_at: "2013-03-15 03:41:53", updated_at: "2013-03-15 03:41:53", category_type: nil, category_parent_id: 2&gt;
  </code></pre>
  
  <p>So this only added 1 entry from the seed file. If none of these exist why aren't they all being entered?</p>
  
  <p>Thanks for any help. :)</p>
  
  <hr>
  
  <p><strong>ANSWERED THANKS TO JIM AND JOHN</strong></p>
  
  <p>Thanks to Jim and John I was able to change my code to work with the following solution.</p>
  
  <pre><code>category_options = [
    {name: "TV", category_parent_id: 2},
    {name: "Oven", category_parent_id: 2},
    {name: "Fridge", category_parent_id: 2},
    {name: "Microwave", category_parent_id: 2},
    {name: "Toaster", category_parent_id: 2}
  ]
  
  categories = category_options.each do |c|
  Category.find_or_create_by_name_and_category_parent_id(c)
  end
  </code></pre>