Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rails 7.1 edge support #179

Closed
tagliala opened this issue Oct 1, 2022 · 5 comments
Closed

Add Rails 7.1 edge support #179

tagliala opened this issue Oct 1, 2022 · 5 comments

Comments

@tagliala
Copy link
Member

tagliala commented Oct 1, 2022

  undefined method `direct_descendants' for class `#<Class:Bar(id: integer, name: string, foo_id: integer)>'

Bisected to rails/rails@1aa2463 rails/rails#46144

ActiveSupport::DescendantsTracker.direct_descendants is deprecated and will be removed in Rails 7.1.
Use ActiveSupport::DescendantsTracker.subclasses instead.
@tagliala
Copy link
Member Author

tagliala commented Oct 1, 2022

Another breaking change:

rails/rails@57bc28f rails/rails#44576

tagliala added a commit that referenced this issue Oct 1, 2022
Rails 7.1 removed the deprecated method `direct_descendants` in favor
of `subclasses`

Ref #179

Ref: rails/rails@1aa2463 rails/rails#46144
tagliala added a commit that referenced this issue Oct 1, 2022
This works with either `adapter.materialize_transactions` before
the savepoint creation or by skipping the savepoint entirely and
reverting the migration by raising `ActiveRecord::Rollback`

Close #179

Ref: rails/rails@57bc28f rails/rails#44576
@tagliala
Copy link
Member Author

tagliala commented Oct 2, 2022

Subclasses is not an alias of direct_descendants until rails/rails@8f8aa85 rails/rails#39505

tagliala added a commit that referenced this issue Oct 2, 2022
Rails 7.1 removed the deprecated method `direct_descendants` in favor
of `subclasses`

Before Rails 6.1.0 stable, `subclasses` was not an alias of
`direct_descendants`, and a conditional management is tricky to implement, so
this commit implements support for subclasses starting from 6.1.0

Ref #179

Ref:
- rails/rails@8f8aa85 rails/rails#39505
- rails/rails@1aa2463 rails/rails#46144
tagliala added a commit that referenced this issue Oct 2, 2022
This works with either `adapter.materialize_transactions` before
the savepoint creation or by skipping the savepoint entirely and
reverting the migration by raising `ActiveRecord::Rollback`

Close #179

Ref: rails/rails@57bc28f rails/rails#44576
tagliala added a commit that referenced this issue Oct 2, 2022
This works with either `adapter.materialize_transactions` before
the savepoint creation or by skipping the savepoint entirely and
reverting the migration by raising `ActiveRecord::Rollback`

Close #179

Ref: rails/rails@57bc28f rails/rails#44576
tagliala added a commit that referenced this issue Oct 2, 2022
This works with either `adapter.materialize_transactions` before
the savepoint creation or by skipping the savepoint entirely and
reverting the migration by raising `ActiveRecord::Rollback`

Close #179

Ref: rails/rails@57bc28f rails/rails#44576
@tagliala
Copy link
Member Author

tagliala commented Oct 2, 2022

subclasses doesn't work with Ruby 3.1 stable

tagliala added a commit that referenced this issue Oct 3, 2022
Rails 7.1 removed the deprecated method `direct_descendants` in favor
of `subclasses`

Subclasses implementation should be added in a different PR because it is not
trivial to implement

Ref #179

Ref:
- rails/rails@8f8aa85 rails/rails#39505
- rails/rails@1aa2463 rails/rails#46144
tagliala added a commit that referenced this issue Oct 3, 2022
This works with either `adapter.materialize_transactions` before
the savepoint creation or by skipping the savepoint entirely and
reverting the migration by raising `ActiveRecord::Rollback`

Close #179

Ref: rails/rails@57bc28f rails/rails#44576
@tagliala
Copy link
Member Author

tagliala commented Oct 3, 2022

Another breaking change

  1) rails dbconsole rails dbconsole is expected to be successfully executed
     Failure/Error: specify { expect(last_command).to be_successfully_executed }

       Expected `bash -c "echo 'select 1 as foo_column; \q' | bundle exec rails db"` to succeed but got non-zero exit status and the following output:

       Unknown command-line client for chronomodel_railsapp.

  2) rails dbconsole rails dbconsole is expected to have output: /\bfoo_column\b/
     Failure/Error: specify { expect(last_command).to have_output(/\bfoo_column\b/) }

@tagliala
Copy link
Member Author

tagliala commented Oct 8, 2022

dbconsole change:

rails/rails@4bcb8e4 rails/rails#46093

tagliala added a commit that referenced this issue Oct 8, 2022
Rails 7.1 removed the deprecated method `direct_descendants` in favor
of `subclasses`

Subclasses implementation should be added in a different PR because it is not
trivial to implement

Ref #179

Ref:
- Alias direct_descendants as subclasses: rails/rails@8f8aa85 rails/rails#39505
- Filter reloaded classes in Class#subclasses and Class#descendants core exts: rails/rails@1aa2463 rails/rails#46144
tagliala added a commit that referenced this issue Oct 8, 2022
This works with either `adapter.materialize_transactions` before
the savepoint creation or by skipping the savepoint entirely and
reverting the migration by raising `ActiveRecord::Rollback`

Close #179

Ref: rails/rails@57bc28f rails/rails#44576
@tagliala tagliala changed the title Chronomodel breaks with Rails Edge Add Rails 7.1 edge support Oct 8, 2022
tagliala added a commit that referenced this issue Oct 8, 2022
Rails 7.1 removed the deprecated method `direct_descendants` in favor
of `subclasses`

Subclasses implementation should be added in a different PR because it is not
trivial to implement

Ref #179

Ref:
- Alias direct_descendants as subclasses: rails/rails@8f8aa85 rails/rails#39505
- Filter reloaded classes in Class#subclasses and Class#descendants core exts: rails/rails@1aa2463 rails/rails#46144
tagliala added a commit that referenced this issue Oct 8, 2022
This works with either `adapter.materialize_transactions` before
the savepoint creation or by skipping the savepoint entirely and
reverting the migration by raising `ActiveRecord::Rollback`

Close #179

Ref: rails/rails@57bc28f rails/rails#44576
tagliala added a commit that referenced this issue Oct 8, 2022
- Rails 7.0 deprecated the `direct_descendants` method in favor of `subclasses`
- Ruby 3.1 added native `subclasses` support to `Class`

Ref #179

Ref:
- Alias direct_descendants as subclasses: rails/rails@8f8aa85 rails/rails#39505
- Filter reloaded classes in Class#subclasses and Class#descendants core exts: rails/rails@1aa2463 rails/rails#46144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant