burm
burm copied to clipboard
EASY: Add property names to the Model object
Currently, in the model object schema, there are some properties like hasParameter
(function), name
(string), and parameters
(object). I think it would be cool that in the file where we create the model object, we also add in the columns that the user defined for the model.
You might be wondering what the use case for this would be, but it would be mainly used for what I'm going to show below. Using this below could make the code much more readable and simple to understand, but in the end, User.id
would also have the value of "id"
, so the two would be identical in function.
const userData = User.findOne({
where: Condition.Equals("id", 1)
})
Turns into
const userData = User.findOne({
where: Condition.Equals(User.id, 1)
})
Hey, William. I can do this change as you mentioned above.
Sounds good @Deepu178!