Custom auto incrementation string field

advertisements

I need to save a custom auto increment string when someone create an order like this:

ID | CUSTOM_ID
1  | product-001
2  | service-001
3  | service-002
4  | product-002

What's the best way in ruby on rails to limit queries ?


Here a gem called Protokoll, as the description says : Protokoll is a simple Rails gem to create custom autoincrement values to a database column, never used it before but at you to see if this is what do you search for. Hope this help you