how do i copy the active attachments to a new object?

I ended up getting this working by using the https://github.com/moiristo/deep_cloneable gem. Final action:

  def copy
   @source = Compitem.find(params[:id])
   @compitem = @source.deep_clone(include: :uploads_blobs)
   @compitem.save
   render 'new'
  end

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top