title: Rails 4 Duplicating Model Objects and Merging New Object attribtues (Amoeba Gem)
body: <p>What I'm doing: Duplicating a record of my Project model then overwriting the modified attributes from an object submitted by a form. The new record should be modified but have all the associations as the original.</p>
  
  <p>The first step I took was to duplicate a AR Model object, including its associations, which I'm doing with Amoeba gem.</p>
  
  <p><strong>projects_controller.rb</strong></p>
  
  <pre><code>...
  def create
      if params[:copy]
          orig_project = Project.find params[:copy]
          @new_project = orig_project.amoeba_dup
  ...
  </code></pre>
  
  <p>Now I would like to merge my project_params into the @new_project object overwriting the attributes if the attributes are different.</p>
  
  <p><strong>projects_controller.rb</strong></p>
  
  <pre><code>...
  def create
      if params[:copy]
          orig_project = Project.find params[:copy]
          @new_project = orig_project.amoeba_dup
  
          my_merge_method(@new_project,project_params)
  ...
          if @new_project.save
  </code></pre>
  
  <p>Could anyone provide a good way to do this with some rails magic? Thanks</p>