City-of-Bloomington / inRoads

Digital service to publish road, sidewalk and parking status information including closings, lane reductions and reservations. Generates feeds for Waze Connected Cities program.
https://bloomington.in.gov/inroads
GNU Affero General Public License v3.0
9 stars 4 forks source link

Model validation does not match ActiveRecord's expectations #175

Closed inghamn closed 6 years ago

inghamn commented 6 years ago

InRoad's models were written with a validation function that returns an array of errors. However, Blossom's ActiveRecord class expects the validate function to throw exceptions.

The custom error handling was removed from inRoad's ActiveRecord library back in 2015, but the models were never updated to account for this.

7e1c5dde086b9125bde310858ccd46208c110594

The models need to match their validation to what Blossom's ActiveRecord class expects. This means it will, in fact, only show one form error at a time, since the first exception will halt everything.

We'll need to address this in a future rewrite.

inghamn commented 6 years ago

This is one of the reasons #163 is happening