Commit 9bf2eeb
authored
Add ActiveRecord::Relation#table_name type (#1010)
* Add ActiveRecord::Relation#table_name type
## Overview
`ActiveRecord::Relation#table_name` is delegated to the model class via `method_missing`, but it was not defined in the RBS type definitions. This causes Steep to report a `NoMethodError` when calling `table_name` on a Relation instance.
This PR adds the `table_name` method definition to `ActiveRecord::Relation` with a return type of `String`.
## References
- Source: `ActiveRecord::ModelSchema::ClassMethods#table_name`
- https://api.rubyonrails.org/classes/ActiveRecord/ModelSchema/ClassMethods.html#method-i-table_name
- https://github.com/rails/rails/blob/v7.0.8/activerecord/lib/active_record/model_schema.rb#L247-L250
* Move table_name definition from ActiveRecord::Relation to ActiveRecord::Delegation1 parent 9fe4350 commit 9bf2eeb
File tree
5 files changed
+22
-0
lines changed- gems/activerecord
- 6.0
- 7.2
- _test
- 8.0
- _test
5 files changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
406 | 412 | | |
407 | 413 | | |
408 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
413 | 419 | | |
414 | 420 | | |
415 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
413 | 419 | | |
414 | 420 | | |
415 | 421 | | |
| |||
0 commit comments