I am pretty new to Ruby on Rails and have been studying it using the Ruby on Rails Tutorial by Michael Hartl.
I am now working on my own project, which allows users to log in the website, provide personal biometric information and upload a csv file of their choice(workout data) to populate the database with the workout information.
I sought help from other friends with more experience and their advice was to create a staging table and use the staging table to populate the other tables(I currently have eight different tables for workout measurements).
I did quite a bit of research on staging table usage online, but couldn't find a solid answer to how to effectively use a staging table to import a csv file into multiple models.
From my understanding of staging tables, I should reset the staging table every time I(the user) is done uploading and importing the csv file into the database, but could not find anything online on whether it is the right practice or not.
Is this the right approach to using staging tables? The only other option that I can think of is creating and dropping a staging table every time the user uploads a file, but that seems too costly for it to be correct.
Thanks!