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

Rails 7.1 composite key support #1018

Open
freibuis opened this issue Oct 22, 2023 · 1 comment
Open

Rails 7.1 composite key support #1018

freibuis opened this issue Oct 22, 2023 · 1 comment

Comments

@freibuis
Copy link

using rails 7.1 with composite + freindly_id will give the following error

extend FriendlyId
friendly_id :name, use: :slugged
`scope_for_slug_generator': ["column_one", "column_two"] is not a symbol nor a string (TypeError)
scope.where(self.class.base_class.arel_table[primary_key_name].not_eq(send(primary_key_name)))

normally the

primary_key_name = self.class.primary_key

would return a string but with composite keys it will return an array.

so above example is

self.class.primary_key  
 ["column_one", "column_two"]
@Mechetel
Copy link

same

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

2 participants