Skip to content

:history fails when trying to reuse slugs #1009

Description

@mreq

Steps to reproduce:

  1. create an instance a of a Model with slug foo
  2. change slug of a to bar
  3. try to create an instance b of a Model with slug foo
  4. you'll get an ActiveRecord::RecordNotUnique exception

Ways to fix:

a) validate the slug respecting friendly_id_slugs table
b) preferred - remove the old slug if it's not the current one and make the instance b invalid via validating if it is

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions