FriendlyId is the “Swiss Army bulldozer” of slugging and permalink plugins for ActiveRecord. It allows you to create pretty URL’s and work with human-friendly strings as if they were numeric ids for ActiveRecord models.
Without considering this, you may get errors like this in your app:
ActiveRecord::StrictLoadingViolationError: `Organization` is marked for strict_loading. The FriendlyId::Slug association named `:slugs` cannot be lazily loaded.
/Users/gjtorikian/Development/yettoapp/yetto/db/seeds.rb:15:in `<main>'
I decided for my app this was an okay performance "hit" (read: I didn't want to figure out how to fix it). It would be good to advise users that they can add the following to their model to disable the check on any calls to the slugshas_many association:
đź‘‹ Modern Rails (> 6) now support ways for automatically detecting N+1 queries: https://dev.to/junko911/rails-n-1-queries-and-eager-loading-10eh
Without considering this, you may get errors like this in your app:
I decided for my app this was an okay performance "hit" (read: I didn't want to figure out how to fix it). It would be good to advise users that they can add the following to their model to disable the check on any calls to the
slugs
has_many
association: