Closed ConfusedVorlon closed 2 years ago
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.
still true in
friendly_id (5.4.2) rails 7.0.2
notably - the rails app runs, but any test run through rspec breaks
An error occurred while loading ./spec/models/meditation_hls_spec.rb.
Failure/Error: extend FriendlyId
NoMethodError:
undefined method `slug_limit=' for #<#<Class:0x000000016e1f7790>:0x000000016e1f7718 @base=nil, @model_class=Meditation(id: integer, slug: string, title: string, description: text, duration: integer, published: boolean, account_id: integer, created_at: datetime, updated_at: datetime, time_of_day: integer, brain_state: integer, guide_id: integer, artist_id: integer, hls_transcode_id: integer), @defaults={}, @modules=[], @finder_methods=FriendlyId::FinderMethods, @routes=:friendly, @reserved_words=["new", "edit", "index", "session", "login", "logout", "users", "admin", "stylesheets", "assets", "javascripts", "images"]>
config.slug_limit = 25
^^^^^^^^^^^^^
# ./config/initializers/friendly_id.rb:63:in `block in <main>'
# /Users/rob/.rvm/gems/ruby-3.1.2/gems/friendly_id-5.4.2/lib/friendly_id.rb:85:in `block in extended'
# /Users/rob/.rvm/gems/ruby-3.1.2/gems/friendly_id-5.4.2/lib/friendly_id.rb:82:in `class_eval'
# /Users/rob/.rvm/gems/ruby-3.1.2/gems/friendly_id-5.4.2/lib/friendly_id.rb:82:in `extended'
# ./app/models/meditation.rb:48:in `extend'
# ./app/models/meditation.rb:48:in `<class:Meditation>'
# ./app/models/meditation.rb:36:in `<main>'
# /Users/rob/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
# /Users/rob/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
# /Users/rob/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
# ./spec/models/meditation_hls_spec.rb:38:in `<main>'
# /Users/rob/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `load'
# /Users/rob/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `load'
uncommenting in the initialiser:
config.slug_limit = 255
immediately throws the error:
I'm on Rails 6.1.4
trace:
there is a github issue on a similar note which suggests just limiting on a per app basis (which does work) https://stackoverflow.com/questions/66036641/undefined-method-slug-limit-for-friendly-id