Skip to content

Fix type of ActiveSupport::Messages::Metadata #909

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

Merged
merged 1 commit into from
Jul 9, 2025

Conversation

richardboehme
Copy link
Contributor

This is now a module and no class anymore. Also most generated methods for it do not exist anymore.

Fixes #883

Copy link

github-actions bot commented Jul 9, 2025

@richardboehme 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

activesupport

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

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

@richardboehme richardboehme force-pushed the activesupport-metadata-fix branch from d6ed681 to 03a1b4a Compare July 9, 2025 07:28
module ActiveSupport
module Messages
module Metadata
def self.pick_expiry: (untyped expires_at, untyped expires_in) -> untyped
Copy link
Collaborator

Choose a reason for hiding this comment

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

pick_expiry seems singleton private method.

https://github.com/rails/rails/blob/33ecfc320160cae0626b71fe0a1838bd19f1a5a0/activesupport/lib/active_support/messages/metadata.rb#L31

Does your application require this method type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No it's just the only method left from the generated ones that still exists. Should we remove it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, If there is no use case, I believe the best approach is to remove it.
Singleton private methods have very limited use and are likely only used internally in Rails or through monkey patching.

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 agree and removed the method signature, so this should be good to go.

This is now a module and no class anymore. Also most generated methods
for it do not exist anymore.
@richardboehme richardboehme force-pushed the activesupport-metadata-fix branch from 03a1b4a to db9272e Compare July 9, 2025 08:42
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

github-actions bot commented Jul 9, 2025

Thanks for your review, @ksss!

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

@richardboehme
Copy link
Contributor Author

/merge

@github-actions github-actions bot merged commit ab3a47a into ruby:main Jul 9, 2025
7 checks passed
@richardboehme richardboehme deleted the activesupport-metadata-fix branch July 9, 2025 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ActiveSupport::Messages::Metadata has wrong type for ActiveSupport 7
2 participants