norman/friendly_id — pull request #196 by erikogan (2011-12-12 18:28:53+00:00)
Title: Minor alteration to sequence extraction in slug_generator.rb

This came about because we'd like to use a single hyphen as the sequence separator. The current implementation assumes the separator is unique and safe to just split on it.

My first inclination was to simply change the array index on the split to -1. That would work MOST of the time, except when the last word of a non-sequenced slug happens to start with a number. (A year, for example)

This solution better covers all cases, and possibly more straightforward as well.

All of the tests pass, I debated adding a new one to cover this case, and would be happy to do so if you'd prefer.