title: How to stop create in rails 5 without rolling back changes?
body: <p>I need to check if a similar record exist in database before save, if true then update the existing record without saving, else create a new one</p>
  
  <p>In rails 5:
  returning false in a hook method doesn't halt callbacks and "throw :abort" is used instead.</p>
  
  <p>the problem is using "throw :abort" rolls back any changes made in the before_save callback.</p>
  
  <p>what I am trying to do is to check for a similar recored in "before_save" and if a similar record exist I need to update the current record and stop saving the new one.</p>
  
  <p>I used</p>
  
  <pre><code>before_save :check
  def check
      if (similar record exist..)
         update current...
         return false &lt;==========
      end
      true
  end
  </code></pre>
  
  <p>but this is not working any more in Rails 5 so returning false doesn't stop it from saving the new record too.</p>
  
  <p>and I tried</p>
  
  <pre><code>before_save :check
  def check
      if (exist..)
         update current...
         throw :abort &lt;========
      end
      true
  end
  </code></pre>
  
  <p>this stops saving current record to db but it perform "rollback" so the updated recored is missed !!</p>
  
  <p>how can I do that ?</p>