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

This gem prevents using friendly_id with non-translated slugs on some models of the same project #27

Open
thedarkside opened this issue Sep 20, 2021 · 0 comments

Comments

@thedarkside
Copy link

thedarkside commented Sep 20, 2021

This gem adds a locale column to the friendly_id_slugs table with null: :false. This way it enforces slugs being translated project wide.

If one wants a translated slug with history on model A but a non-translated slug with history on model B the current behavior is the current locale is being saved for the non-translated slug on model B too!

This is due to the implementation of the slug_decorator only taking the existence of the locale column into account.

The current implementation of the friendly_id-mobility gem does not allow such a hybrid usage of the friendly_id gem but it should!

Suggestion:

  • The usage of the :mobility plugin should be checked in the slug_decorator too!
  • The not null constraint should be loosened up to allow locale being null for non-translated slugs.

What do you think?

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

1 participant