nxus / admin

Admin screens for Nxus applications
1 stars 0 forks source link

default handler for editing records in a model doesn't coerce attribute types before saving #4

Closed ScottMaxson closed 8 years ago

ScottMaxson commented 8 years ago

Checking out the current app-boilerplate, working with simple models and trying to save a new record, or edit an existing record:

nxus:mvc-test-item-admin:error [Error (E_VALIDATION) 1 attribute is invalid] Invalid attributes sent to mvc_test_item: • number • undefined should be a number (instead of "1001", which is a string)

_Stack trace #1_ Error (E_VALIDATION) :: 1 attribute is invalid at WLValidationError.WLError (/media/disk2/projects/nxus4/app-boilerplate/node_modules/waterline/lib/waterline/error/WLError.js:25:15)

image

loppear commented 8 years ago

ha, actually coercion works fine in waterline. The dummy model that's in app-boilerplate defines an attribute with the type 'number' which waterline and web don't know how to coerce - WL only supports "float" and "integer". Changed this to integer in app-boilerplate and things are working again.