umts / stop-project

Rails app for tracking the Summer 2016 installation of new bus stop signs across the PVTA service area.
MIT License
0 stars 1 forks source link

None of the "super hash" inclusion validations work #269

Closed werebus closed 11 months ago

werebus commented 1 year ago

https://github.com/umts/stop-project/blob/c721d5ebc2f9f220f13c819257cadff2bad33175/app/models/bus_stop.rb#L175-L179

When you call each on a Hash with one block variable, each entry in the hash gets made into an array. That .each on line 175 shoud be .each_value — the values in the hash are hashes.

Of course, this has been broken a long time and fixing it causes a lot of invalid data in production.