Ticket #900 (closed enhancement: fixed)

Opened 16 months ago

Last modified 16 months ago

Sluggable template does not generate unique slugs

Reported by: jphilip Owned by: somebody
Priority: major Milestone: 0.10.4
Component: Other Version: 0.10.0
Severity: Keywords:
Cc: Has Test:
Status: Has Patch:

Description

This is an enhanced version of the sluggable template, it adds a few options:

unique: true (The default) Generates a unique slug by adding incremental -xxx at the end uniqueBy: [field1, field2...] Generates a unique slug but allow the same slug when field1, field2 are the same uniqueIndex: true (The default) Generates a unique index in the table for the slug (The index is based on the field of the name option, plus the uniqueBy fields)

- Also when the option fields is empty and a method named getUniqueSlug exits in the model, it is used to generate the slug.

- Also works to make the slug unique when it is set manually or updated by a user.

The test case joined has 27 tests that pass.

Attachments

sluggable.patch (15.5 KB) - added by jphilip 16 months ago.

Change History

Changed 16 months ago by jphilip

Changed 16 months ago by jwage

  • status changed from new to closed
  • resolution set to fixed

(In [4066]) fixes #900

Note: See TracTickets for help on using tickets.