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

Add support for Rails 7 #460

Closed peterberkenbosch closed 2 years ago

mindtonic commented 2 years ago

+1 Please! +2 Please!

akodkod commented 2 years ago

+1

akodkod commented 2 years ago

As a temporary solution you can add this to your Gemfile:

gem "awesome_nested_set", github: "peterberkenbosch/awesome_nested_set", branch: "rails-7-support"
peterberkenbosch commented 2 years ago

Looking at fixing the failing specs around ruby versions:

Bundler found conflicting requirements for the Ruby version:
    In rails_7_0.gemfile:
      Ruby

      awesome_nested_set was resolved to 3.4.0, which depends on
        Ruby (>= 2.0.0)

      rails (~> 7.0.0) was resolved to 7.0.0, which depends on
        Ruby (>= 2.7.0)
  Took   3.44 seconds
parndt commented 2 years ago

@peterberkenbosch perhaps we can address different versions like this one so the library itself isn't coupled to what Rails 7 supports https://github.com/norman/friendly_id/pull/984

thanks for looking at this

peterberkenbosch commented 2 years ago

Hey @parndt. Good find.. on it! Thanks.

andrewhampton commented 2 years ago

@peterberkenbosch I've finished getting the tests passing and opened a PR to this branch on your repository.

@parndt as part of that change, I had to drop the combustion gem. The older version currently required by awesome_nested_set doesn't work with rails 7. I initially tried updating combustion, but the API has changed and you can no longer pass in the database config you want. So I'm just using the rails tasks directly and dropped that dependency. Hopefully that's ok?

peterberkenbosch commented 2 years ago

Thanks @andrewhampton!