bikeindex/bike_index — pull request #37 by pdk (2014-01-29 07:46:25+00:00)
Title: added xyz_code to bikes

I included the bits to exclude lookup codes that have only digits, and the double V thing. You should be able to do a regexp on the id param and decide to lookup by id or by xyz_code. No need to do 2 queries to figure out which key to use.

There's a migration to set lookup codes for existing bikes (using update_attribute for minimal data disruption). And there's a simple before_save callback to set the code for any new records.