How does the model "magic" happen #2016
willowlight
started this conversation in
General
Replies: 1 comment 1 reply
-
Looking at the docs I found this:
I assume if I had to explicitly tell which table I'd do class And why it works without explicitly specifying must be because Sequel tries to figure out based on the Model name? |
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 DB table named Categories and my model is named Category. Everything works correctly, but how does the Model know that the correct table to add data to is Categories ?
It made sense to me when I have a table called users and the model is User as it's just the plural version, but I don't get how it can figure out the Categories scenario.
This brings me to my next question, if needed, can you manually specify which table the Model is associated with?
Beta Was this translation helpful? Give feedback.
All reactions