irelius / Lairbnb

0 stars 0 forks source link

Revise models #12

Open irelius opened 4 months ago

irelius commented 4 months ago
irelius commented 4 months ago

Image model refactored to allow for polymorphic associations. Will require future testing to see if this correctly creates the relationships however.

irelius commented 4 months ago

Booking model refactored to use DataType.DATE for the booking's startDate and endDate. Using DATE instead of DATEONLY to allow for future usage of time? But it doesn't seem necessary. Might switch to DATEONLY

irelius commented 4 months ago

Spot model will be refactored in the future. Currently no changes needed, but will need to change when implementing Google Maps API. Property of "previewImg" removed and allocated to separate Image table.

irelius commented 1 month ago

previewImg was removed from Spots table and relocated to Images table.

Further revision of model/migrations was implemented with model level validations. Any validations I could not figure out how to do on the model level was done via middleware

Models may still require future update when implementing Google Maps API