title: Best way to find_or_create_by_id but update the attributes if the record is found
body: <p>I'm looking for a clean way to create a record with a set of attributes if the record does not exist and - if the record do exist - to update its attributes. I love the syntax of the block in the find_or_create_by_id call. Here's my code:</p>
  
  <pre><code>@categories = Highrise::DealCategory.find(:all)
  
  @categories.each do |category|
    puts "Category: #{category.name}"
  
    Category.find_or_create_by_id(category.id) do |c|
      c.name = category.name
    end
  end
  </code></pre>
  
  <p>The problem here is that if the record exists but the name has changed, it is not being updated.</p>
  
  <p>Looking for a clean solution to this problem...</p>