Closed alienxp03 closed 1 year ago
you should stick the normalize_friendly_id
method inside your concern's included
block so that it runs in the context of the model, not the concern.
Thanks. Overthinking and overlooked that part. Thanks for your help!
Related to previous issue, but in a different way. Couldn't find a workaround yet at the moment. https://github.com/norman/friendly_id/issues/825
For this code,
custom_method
is being called, butnormalize_friendly_id
is not.In the previous issue, the workaround works because they're not using any custom method, or rather have the same candidate column name for each of their class. In this case, I couldn't use
friendly_id :name, use: :slugged
since not all of my tables have the columnname
.I've to use
friendly_id :id, use: :slugged
sinceid
exist in all tables but doesn't seems to be working as well.Using friendly_id 5.5.0, Ruby 3.2.0, Rails 7.0.4