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

Rails 6 support #402

Closed neilmiddleton closed 5 years ago

neilmiddleton commented 5 years ago
6:42:13 PM web.1 |  2019-05-02 18:42:13 - ArgumentError - Unknown key: :order. Valid keys are: :class_name, :anonymous_class, :foreign_key, :validate, :autosave, :table_name, :before_add, :after_add, :before_remove, :after_remove, :extend, :primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache, :join_table, :foreign_type, :index_errors:
6:42:13 PM web.1 |      /Users/nmiddleton/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0.rc1/lib/active_support/core_ext/hash/keys.rb:52:in `block in assert_valid_keys'
6:42:13 PM web.1 |      /Users/nmiddleton/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0.rc1/lib/active_support/core_ext/hash/keys.rb:50:in `each_key'
6:42:13 PM web.1 |      /Users/nmiddleton/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0.rc1/lib/active_support/core_ext/hash/keys.rb:50:in `assert_valid_keys'
6:42:13 PM web.1 |      /Users/nmiddleton/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-6.0.0.rc1/lib/active_record/associations/builder/association.rb:67:in `validate_options'
6:42:13 PM web.1 |      /Users/nmiddleton/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-6.0.0.rc1/lib/active_record/associations/builder/association.rb:40:in `create_reflection'
6:42:13 PM web.1 |      /Users/nmiddleton/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-6.0.0.rc1/lib/active_record/associations/builder/association.rb:30:in `build'
6:42:13 PM web.1 |      /Users/nmiddleton/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-6.0.0.rc1/lib/active_record/associations.rb:1371:in `has_many'
6:42:13 PM web.1 |      /Users/nmiddleton/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/awesome_nested_set-2.1.6/lib/awesome_nested_set/awesome_nested_set.rb:84:in `acts_as_nested_set'
a-ta-ta commented 5 years ago

Tried to update to 3.1.4 but:

Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    awesome_nested_set (~> 3.1.4) was resolved to 3.1.4, which depends on
      activerecord (< 5.3, >= 4.0.0)

    rails (~> 6.0.0rc1) was resolved to 6.0.0.rc1, which depends on
      activerecord (= 6.0.0.rc1)

Seems like it happens because of rails-rspec dependency (somewhere it contains '<5.3') I updated it to 3.8 (from 3.5) and error doesn't appear.

parndt commented 5 years ago

Fixed by #401

To use until a version is released with this change:

gem 'awesome_nested_set', github: 'collectiveidea/awesome_nested_set', branch: 'master'