You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When defining a model, it appears that only attributes are getting converted to camelCase but relationship keys have to be defined in snake case or else I get the error Unknown type "appointment_requests"
I have an Appointment model that is currently setup like this:
However, I currently have to change appointmentRequests to appointment_requests in both models in order to be able to access the related appointment requests from an appointment record. It seems like I should be able to define the relationships in camelCase since other attributes get converted from snake_case to camelCase correctly. Has anyone else seen or run into this issue before?
The text was updated successfully, but these errors were encountered:
@nataliepatton13 I set jsonapiType to what comes from the server, which is in snake_case. Then you can use camelCase relationship names everywhere, such as appointmentRequests.
When defining a model, it appears that only attributes are getting converted to camelCase but relationship keys have to be defined in snake case or else I get the error
Unknown type "appointment_requests"
I have an Appointment model that is currently setup like this:
It has a has many relationship to the AppointmentRequests model that looks like this:
However, I currently have to change
appointmentRequests
toappointment_requests
in both models in order to be able to access the related appointment requests from an appointment record. It seems like I should be able to define the relationships in camelCase since other attributes get converted from snake_case to camelCase correctly. Has anyone else seen or run into this issue before?The text was updated successfully, but these errors were encountered: