roadmap
roadmap copied to clipboard
Download plan as csv records export twice
Please complete the following fields as applicable:
What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
3.1.1
Expected behaviour:
When I download my plan as csv, that should only be recorded once
Actual behaviour:
When I download my plan as csv, it is recorded twice
Possible cause:
- Plan#record_plan_export records every plan export
- Every call to Plan#prepare calls that
record_plan_export -
PlanExportsController#show calls
Plan#as_pdfwhich callsprepareand so records plan export. Almost every export format uses the returned@hash - the csv export is the only place where that
@hashis NOT used. Plan#as_csv also callsprepareso download is recorded twice.
Maybe call this method Plan#record_plan_export more explicitly in the client code, in order to prevent this kind of issues?
Need to investigate how and where the plan_exports table is used. If it is no longer important we should consider removing it