diff --git a/lib/friendly_id/sequentially_slugged.rb b/lib/friendly_id/sequentially_slugged.rb index c86fd230a..c1a16233b 100644 --- a/lib/friendly_id/sequentially_slugged.rb +++ b/lib/friendly_id/sequentially_slugged.rb @@ -36,6 +36,7 @@ def next_sequence_number end def last_sequence_number + regexp = /#{slug}#{sequence_separator}(\d+)\z/ # Reject slug_conflicts that doesn't come from the first_candidate # Map all sequence numbers and take the maximum slug_conflicts.reject{ |slug_conflict| !regexp.match(slug_conflict) }.map do |slug_conflict|