ActiveStorage dynamic proxy methods not surfaced
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 873
- Forks
- 164
- Avg merge
- 4d 27m
- Merged PRs (30d)
- 9
Description
I'm actually not 100% sure if this issue belongs here, in sorbet-rails, or somewhere else. Please redirect me to wherever would have responsibility for this!
However, generated RBIs do not include those proxy methods, which means operations like model.file.**open** raise a typechecking error, despite that method both existing and working. A workaround is to use model.file**_blob**.open, but this is not the documented API so I'm nervous using it - I imagine it's more likely to change in future.
I'd expect the RBI for ActiveStorage::Attached::One to include these methods so that typechecking can be used when accessing the files as documented.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how Tapioca generates RBIs for ActiveStorage::Attached::One and compare the generated interface with ActiveStorage's documented proxy methods. Done means the generated RBI exposes methods such as open so typechecking accepts documented calls like model.file.open without requiring model.file_blob.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100