title: Why first_or_initialize try to save record?
body: <p>In a Rails 3.2 app I have a simple association</p>
  
  <pre><code>class Element &lt; ActiveRecord::Base
    has_many :categories
  end
  
  class Category &lt; ActiveRecord::Base
    belongs_to :element
    validates :name, uniqueness: true
  end
  </code></pre>
  
  <p>And the following code</p>
  
  <pre><code>element = Element.find_or_initialize_by_name(elem_name)
  element.categories = cat_names.map { |name| Category.where(name: name, element_id: element).first_or_initialize }
  </code></pre>
  
  <p>raises <strong>ActiveRecord::RecordNotSaved (Failed to replace resources because one or more of the new records could not be saved.)</strong> when cat_names includes a name already taken. </p>
  
  <p>From my understanding first_or_initialize calls 'new' so no record should be saved. 
  Is this an expected behavior? </p>
  
  <p>Thanks.</p>