Open mboneil10 opened 6 years ago
How would you propose to implement this?
There's an ActiveRecord::ValueTooLong
error. Hm. I thought that the user wouldn't have to see the actual error and could get a more reasonable error message.
to add it to object.errors.full_messages
(because I'm assuming that goes in the flash on your page), you can do a model validation right?
How will you apply that Rails validation to only one field?
Custom validations. Not saying it's the best way, but it's certainly possible.
I'm still not sure what you mean. I mean at the code level - given that fields are database objects in the new design - what code or pseudocode would we plan to write to apply validations based on individual database objects?
I think when I wrote my comment above, I was confused and thought we were talking about a different app. It can be disregarded.
However I'm not sure of what the 'maximum length' is being validated here. If there isn't a real business request or technical concern involved, I'd recommend closing this issue.
We should ask Liza what specifically she meant by this, and if it's still needed.
I can add a maximum length to the text field.
Liza suggested that we validate maximum length for the "vehicle damage area" (
incident_report_damage_to_bus_x
). I'll try to see if there's anything else we should add validations to in the fields.