Overriding primary key in Rails
http://ruby-journal.com/how-to-override-default-primary-key-id-in-rails
Depends how far you want to take it. But basic idea is that a primary key is really only a key with non null and unique constraints. There’s a syntax for doing that in migrations (not null) and with a custom index (unique constraint). Then make sure you define self.primary_key in your model. Lastly set the param in the routes file so you can do params[:name]. Don’t override the #id methods for your model, too many other Rails methods rely on them.













