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

activerecord: Fix the location of #with_recursive #720

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tk0miya
Copy link
Contributor

@tk0miya tk0miya commented Nov 10, 2024

It is defined at ActiveRecord::QueryMethods, not ActiveRecord:: Relation::QueryMethods.

Unfortunately, it works well even if the wrong location. But it conceals other methods defined in AR::QueryMethods.

refs: #662

It is defined at `ActiveRecord::QueryMethods`, not `ActiveRecord::
Relation::QueryMethods`.

Unfortunately, it works well even if the wrong location.  But it
conceals other methods defined in `AR::QueryMethods`.

refs: ruby#662
Copy link

@tk0miya Thanks for your contribution!

Please follow the instructions below for each change.
See also: https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md

Available commands

You can use the following commands by commenting on this PR.

  • /merge: Merge this PR if CI passes

activerecord

You changed RBS files for an existing gem.
You can merge this PR yourself because you are a reviewer of this gem.
Just comment /merge to merge this PR.

You can also request a review from other reviewers if you want.

def with_recursive: (*untyped) -> untyped
def with_recursive!: (*untyped) -> untyped
end

module QueryMethods
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about merging module QueryMethods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about the sub-modules and classes becoming bigger.

module QueryMethods
  class WhereChain[Relation]
     (long long definitions)
   end

  module OtherMod
    (also very long)
  end

  def with_recursive: (*untyped) -> untyped
  def with_recursive!: (*untyped) -> untyped
end

I know I worry too much, but activerecord is a large library.
Therefore, I think it's better to separate definitions per module or class.
For example, ActiveRecord::Relation and ActiveRecord::Associations have many sub-modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants