Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Doesn't regenerate slugs when using dup #482

Closed
Linuus opened this issue Nov 13, 2013 · 2 comments · Fixed by #483
Closed

Doesn't regenerate slugs when using dup #482

Linuus opened this issue Nov 13, 2013 · 2 comments · Fixed by #483

Comments

@Linuus
Copy link

Linuus commented Nov 13, 2013

It seems that friendly_id doesn't generate/regenerate slugs properly when using dup.

When I run this:

a = Foo.first   # Fetch object from database
b = a.dup
b.save!

b.slug is now the same as a.slug. Shouldn't they always be unique?

Is this the expected behavior?

@norman
Copy link
Owner

norman commented Nov 13, 2013

I'm assuming this is version 5? Yes, I think it should generate a new slug.
I'm on vacation and may not have time to look into it for a few weeks, patches
would be welcome.

Sent from my phone

@Linuus
Copy link
Author

Linuus commented Nov 13, 2013

Yes, version 5.0.1.

No worries. I just set the slug to nil for now when I use .dup.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants