Replies: 1 comment 1 reply
-
@nemo-omen I'm not sure what you're asking for is feasible. From what you describe, you would like to make a union select which brings together all the columns of every table which FKs to I would probably go with a different approach, so rather:
But it is really a matter of your application design. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a Model,
Entry
, from which multiple models inherit abelongs_to
relationship to anotherUpload
model. All models that inherit fromEntry
have their own fields and tables. The only thing they have in common is that each belongs to anUpload
.I was hoping to be able to use that inheritance to query an
Upload
for anyEntry
that belongs to it. I'm not sure how to implement this (or if it's even possible/wise). The code I have so far (below) results in amaximum recursion exceeded
error.I'm trying to allow users to upload different CSV files and, rather than saving the file to disk, enter the file data into the appropriate table with each record referencing the upload. This is an undergraduate project and I'm trying to save resources where I can. If I can't get this to work, I'll just take the more straightforward approach of saving the raw file to disk and adding a
file_path
to the upload instead.Any suggestions would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions