Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Slugs generated 2 times #14

Closed
sowenjub opened this issue Oct 26, 2009 · 8 comments
Closed

Slugs generated 2 times #14

sowenjub opened this issue Oct 26, 2009 · 8 comments

Comments

@sowenjub
Copy link

When I launch rake friendly_id:make_slugs MODEL=MyModel :

  • terminal shows "model(n) friendly_id set to "slug-for-modeln"" for each line in the DB
  • but it records "slug-for-modeln" as sequence 1 AND "slug-for-modeln--2" as sequence 2

I also tried to generate the slugs with send(:set_slug) in the index controller and I get the same result.

This happens whether there is a cached_slug column or not.
When I create a new record, the slug is generated once only.

@norman
Copy link
Owner

norman commented Oct 26, 2009

Thanks for the bug report. I'm working on a fix and will release a new version within a couple hours.

@sowenjub
Copy link
Author

Great thanks for the quick update Norman !
It still puts 2 entries in the DB but doesn't happen "--2" on the second slug so that's harmless.

@gravis
Copy link

gravis commented Oct 27, 2009

same problem here, all slugs were redone twice in slugs, creating cached_slugs with --2 most of the time :(
We're using friendly_id 2.2.2
Thx

@norman
Copy link
Owner

norman commented Oct 27, 2009

Sorry for the lack of clarity, I think you will need to copy the new rake tasks into your lib/tasks folder. You can find it in your Rubygems root at:

gems/friendly_id-2.2.2/lib/tasks/friendly_id.rake

Or, perhaps more conveniently, you can copy it from:

http://github.com/norman/friendly_id/raw/2.2.2/lib/tasks/friendly_id.rake

@gravis
Copy link

gravis commented Oct 27, 2009

Hooo, thanks !
Let me try it (need ~20 minutes to redo all the slugs)

@gravis
Copy link

gravis commented Oct 27, 2009

Sounds to fix the issue ! Thanks a lot Norman for the quick reply, you saved my day ;)

@norman
Copy link
Owner

norman commented Oct 27, 2009

Great! I'm glad it worked for you. Thanks reporting the issue.

@Flink
Copy link
Contributor

Flink commented Oct 30, 2009

I was having the same problem and your solution works just fine! Thanks :)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants