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

actionpack: Add missing methods to ActionController::Parameters #603

Merged
merged 1 commit into from
Jun 16, 2024

Conversation

tk0miya
Copy link
Contributor

@tk0miya tk0miya commented Jun 12, 2024

Some methods for ActionController::Parameters has been missing because they're defined via delegation.

This adds them manually.

refs: https://github.com/rails/rails/blob/v6.0.6.1/actionpack/lib/action_controller/metal/strong_parameters.rb#L214-L215

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

actionpack

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@ksss, 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.

@ksss
Copy link
Collaborator

ksss commented Jun 13, 2024

$ bundle exec rbs diff --detail --format diff --type-name 'ActionController::Parameters' --before gems/actionpack/6.0 --after 603
- [::Kernel public] def to_s: () -> ::String
+ [::ActionController::Parameters public] def to_s: () -> ::String

- -
+ [::ActionController::Parameters public] def keys: () -> ::Array[untyped]

- -
+ [::ActionController::Parameters public] def key?: () -> bool

- -
+ [::ActionController::Parameters public] def has_key?: () -> bool

- -
+ [::ActionController::Parameters public] def values: () -> ::Array[untyped]

- -
+ [::ActionController::Parameters public] def has_value?: () -> bool

- -
+ [::ActionController::Parameters public] def empty?: () -> bool

- -
+ [::ActionController::Parameters public] def include?: (untyped) -> bool

- -
+ [::ActionController::Parameters public] def as_json: () -> ::String

- -
+ [::ActionController::Parameters public] def each_key: () { (untyped) -> untyped } -> ::Hash[untyped, untyped] | () -> ::Enumerator[untyped, self]

@tk0miya tk0miya force-pushed the actioncontroller_parameters_empty branch from 96bce67 to 63e74e8 Compare June 13, 2024 14:33
Some methods for ActionController::Parameters has been missing because
they're defined via delegation.

This adds them manually.

refs: https://github.com/rails/rails/blob/v6.0.6.1/actionpack/lib/action_controller/metal/strong_parameters.rb#L214-L215
@tk0miya tk0miya force-pushed the actioncontroller_parameters_empty branch from 63e74e8 to 89576fd Compare June 13, 2024 14:33
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 Jun 16, 2024

/merge

@github-actions github-actions bot merged commit 3c1c5ab into ruby:main Jun 16, 2024
4 checks passed
@tk0miya
Copy link
Contributor Author

tk0miya commented Jun 16, 2024

@ksss Thank you for reviewing!

@tk0miya tk0miya deleted the actioncontroller_parameters_empty branch June 16, 2024 05:09
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