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

undefined method `slug_pt-br' #776

Closed
feliperaul opened this issue Oct 29, 2016 · 2 comments
Closed

undefined method `slug_pt-br' #776

feliperaul opened this issue Oct 29, 2016 · 2 comments
Labels

Comments

@feliperaul
Copy link

Our default locale is Brazilian Portuguese, so I18n.locale is :"pt-br"

Following the guides, I tried adding a column name slug_pt_br to my Model, but as you see from the error message FriendlyId is trying to look for a column named slug_pt-br.

Should I really set my column name using a hyphen?

@feliperaul
Copy link
Author

Taking a look at the source code, I think that the solution would be add .to_s.underscore to I18n.locale in FriendlyId::SimpleI18n::Configuration slug_column method

def slug_column
    "#{super}_#{I18n.locale.to_s.underscore}"
end

@stale
Copy link

stale bot commented Dec 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 11, 2019
@stale stale bot closed this as completed Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant