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: CollectionProxy#build can take an array of EachPair #718

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

As described above, CollectionProxy#build takes an array of attributes and returns list of instances of the model.

As described above, `CollectionProxy#build` takes an array of attributes
and returns list of instances of the model.
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.

Comment on lines +828 to +829
def build: (?Array[_EachPair] attributes) ?{ () -> untyped } -> Array[untyped]
| (?_EachPair attributes) ?{ () -> untyped } -> untyped
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like you have created the possibility to return an Array even when there are no arguments, is this intentional?

person.pets.build #=> Array[untyped]

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