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: Allow to use array of Hashes to #preload #700

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

tk0miya
Copy link
Contributor

@tk0miya tk0miya commented Oct 27, 2024

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 need to get approval from the reviewers of this gem.

@hibariya, @ksss, @Little-Rubyist, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.

@@ -296,6 +296,8 @@ module ActiveRecord
end

module QueryMethods
type includee = String | Symbol | Array[includee] | Hash[untyped, untyped]
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 not sure this is the best place for this type alias. I'd really appreciate if you give me your opinion.
Thanks,

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the place is good.
Please be aware that recurrent definitions may have bugs and performance risks.
soutaro/steep#1055

(Personally, I am fine with untyped.)

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 don't have a strong opinion of accuracy. So I'm okay to stop using recurrent definitions like this.

Suggested change
type includee = String | Symbol | Array[includee] | Hash[untyped, untyped]
type includee = String | Symbol | Array[untyped] | Hash[untyped, untyped]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Finally, I removed includee type alias. It's only needed for recurrent definitions.

@tk0miya tk0miya force-pushed the activerecord/includee branch from ad5dd9f to d005e80 Compare October 28, 2024 19:05
@tk0miya tk0miya force-pushed the activerecord/includee branch from d005e80 to 4bc9b76 Compare October 28, 2024 19:06
Copy link
Collaborator

@ksss ksss left a comment

Choose a reason for hiding this comment

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

APPROVE

Copy link

Thanks for your review, @ksss!

@tk0miya, @ksss This PR is ready to be merged.
Just comment /merge to merge this PR.

@tk0miya
Copy link
Contributor Author

tk0miya commented Oct 30, 2024

/merge

@github-actions github-actions bot merged commit f1b4f00 into ruby:main Oct 30, 2024
4 checks passed
@tk0miya tk0miya deleted the activerecord/includee branch October 30, 2024 02:13
tk0miya added a commit to tk0miya/conference-app that referenced this pull request Oct 30, 2024
The type of ActiveStorage::Current is now registered to
gem_rbs_collection.  And the type of #preload of active record models
is also fixed.

* ruby/gem_rbs_collection#702
* ruby/gem_rbs_collection#700
tk0miya added a commit to tk0miya/conference-app that referenced this pull request Oct 30, 2024
The type of ActiveStorage::Current is now registered to
gem_rbs_collection.  And the type of #preload of active record models
is also fixed.

* ruby/gem_rbs_collection#702
* ruby/gem_rbs_collection#700
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