collectiveidea / awesome_nested_set

An awesome replacement for acts_as_nested_set and better_nested_set.
MIT License
2.39k stars 492 forks source link

ruby 3.0.0: undefined method `arity' for #439

Closed clwy-cn closed 3 years ago

clwy-cn commented 3 years ago

This error is only in ruby 3.0.0 if I use ruby 2.6.6 or 2.7.2,it works fine.

My Rails version is 6.1.0

This code is causing the problem:

acts_as_nested_set

undefined method `arity' for {:class_name=>"Guide::Page", :foreign_key=>"parent_id", :primary_key=>"id", :counter_cache=>:children_count, :inverse_of=>:children, :polymorphic=>false, :touch=>false, :optional=>true}:Hash

image

parndt commented 3 years ago

Does it work properly if you use the repo version?

gem 'awesome_nested_set', github: 'collectiveidea/awesome_nested_at', branch: 'master'
parndt commented 3 years ago

Alternatively, those changes are now available using version 3.3.0:

gem 'awesome_nested_set', '~> 3.3.0'
damianlegawiec commented 3 years ago

This is fixed with 3.3.x , thank you @parndt 🙏

parndt commented 3 years ago

Thanks to @krisdigital 🙇