spree/spree — pull request #987 by ebeigarts (2012-01-18 09:43:28+00:00)
Title: Fix permalink increments when number is more than one digit long.

This sorts the permalinks first by `LENGTH(permalink) DESC`.
The same approach is used in `friendly_id` gem.