Refactor `Plan.deep_copy(plan)` by aaronskiba · Pull Request #3469 · DMPRoadmap/roadmap

@aaronskiba

Considering that the removed line occurred immediately after  `plan_copy.identifier = plan_copy.id.to_s`, I believe this  was meant to be `plan_copy.save!`. However, rather than correcting the variable, I think the line can be removed completely (explanation below).

The earlier execution of `plan_copy.save!` (line 257) is necessary because we need to generate a pk for `plan_copy`. However, the `duplicate` action within PlansController appears to be the only thing calling Plan.deep_copy, and the action is performing its own save on the copied plan returned from deep_copy:

  def duplicate
    plan = Plan.find(params[:id])
    authorize plan
    @plan = Plan.deep_copy(plan)
    respond_to do |format|
      if @plan.save
       ...