I have a fairly simple file upload system. Whenever multiple files are uploaded, it creates a new record in the database and stores the file name under the field file_leaf. Within the application, you can create subfolders and they are indicated by the boolean branch.

Parent_id is used to determine if a file belongs to a folder. In this example, Sub Folder is a folder who belongs to Test Main Folder. baby_3.jpg is a file that belongs to the folder Test Main Folder.
I have situations where I will drag and drop the files from a folder. This folder may have subfolders and files within the subfolder. How could I get carrierwave to understand that the source of this image was in a sub folder, create the record for the subfolder and then attach the parent_id to the file of the id of the subfolder?

I don't think this is possible. See here: http://www.codeproject.com/Questions/573788/HoeplustoplusGetplustheplusOriginalplusfilepluspat
It appears that you can't know the context of the uploaded file on the source operating system. Therefore you can't create it's original parent folder structure on your system.