I am using FriendlyId
across a bunch of different model. For a particular use-case with usernames, I can't use FriendlyId
but still want to make sure the username is not being used as a slug in any of those models.
Currently, I have a .exists
query for each model using FriendlyId. It doesn't feel super efficient, so I am wondering if there is a more efficient way of doing this by just querying the slugs
column in friendly_id_slugs
table that the library creates?
I'm on Rails 5.1, Postgres 9.5.x and FriendlyId 5.2.3