Skip to content

Change normalizing code example in README.md#70

Open
loqimean wants to merge 1 commit intonorman:masterfrom
loqimean:master
Open

Change normalizing code example in README.md#70
loqimean wants to merge 1 commit intonorman:masterfrom
loqimean:master

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..!


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