activerecord: Add types for `from` to ActiveRecord ClassMethods
Currently, the from method is defined for the ActiveRecord::QueryMethods class, but not for the class method of the ActiveRecord type.
Therefore, User.from(something) is a type error.
However, from is actually used to chain model classes to retrieve records.
The related file in rails/rails has a comment about this. See the link below.
ref. https://github.com/rails/rails/blob/a11f0a63673d274c59c69c2688c63ba303b86193/activerecord/lib/active_record/relation/query_methods.rb#L1359-L1368
@dak2 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, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.
Thanks for your review, @ksss!
@dak2, @ksss This PR is ready to be merged.
Just comment /merge to merge this PR.
/merge