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

Change normalizing code example in README.md #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

loqimean
Copy link

@loqimean loqimean commented Mar 7, 2022

For Rails 7 and friendly_id v5.4.0, the code example was a little bit not good, 'cause not transliterates slug, but this solution is pretty good

Copy link
Collaborator

@parndt parndt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in this review..!

@@ -95,7 +95,7 @@ class Person < ActiveRecord::Base
friendly_id :name, use: :slugged

def normalize_friendly_id(input)
input.to_s.to_slug.normalize(transliterations: :russian).to_s
input.to_slug.transliterate(:ukrainian).normalize.to_s
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@loqimean does this handle the situation where input is nil?

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

Successfully merging this pull request may close these issues.

2 participants