I have checked a bunch questions on this matter, including here, here, and here. I can't seem to figure out what is going wrong here.
Here is my copy method:
def copy(new_period)
copy = self.dup
copy.report_id = Report.maximum(:report_id).next
copy.period_id = new_period
copy.responses = self.responses.dup
copy.save
end
This method correctly makes a copy of the Report model and assigns it to the new period as expected. It also moves all the children from the original report to the new report without duplicating, which is not expected. I don't understand why this is happening.
Anyone have any ideas?