-
Notifications
You must be signed in to change notification settings - Fork 85
Docs: signatures for methods returning relations #214
Conversation
Jared, we do support using Bacon::ActiveRecord_Relation. I do agree with
need better documentation for it
…On Fri, Oct 25, 2019 at 11:55 AM Jared Beck ***@***.***> wrote:
I couldn't find any docs on this, so I'm attempting to write some. I'm not
at all sure this is correct, but will at least start a conversation. Thanks!
------------------------------
You can view, comment on, or merge this pull request online at:
#214
Commit Summary
- Docs: signatures for methods returning relations
File Changes
- *M* README.md
<https://github.com/chanzuckerberg/sorbet-rails/pull/214/files#diff-0>
(14)
Patch Links:
- https://github.com/chanzuckerberg/sorbet-rails/pull/214.patch
- https://github.com/chanzuckerberg/sorbet-rails/pull/214.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#214?email_source=notifications&email_token=AAFH4AMMHJYDSVZ2FKB6ITLQQM6KFA5CNFSM4JFHKU52YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HUOWJKQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFH4AIGYMHO72IJ5NAV6QDQQM6KFANCNFSM4JFHKU5Q>
.
|
Oh, great! Should I update this PR to make that the recommendation? |
Sure, I think we need it. Hopefully we can resolve the issue like with #211 Thanks for helping with the documentation. Here is some thought I've had:
|
Nice! Thanks Harry. I've added your thoughts, and re-organized a little. |
Codecov Report
@@ Coverage Diff @@
## master #214 +/- ##
==========================================
+ Coverage 96.14% 96.22% +0.08%
==========================================
Files 138 138
Lines 2228 2228
==========================================
+ Hits 2142 2144 +2
+ Misses 86 84 -2
Continue to review full report at Codecov.
|
50b1161
to
f5fe551
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I provided some feedback. Please let me know what you think
README.md
Outdated
@@ -19,16 +19,14 @@ This gem adds a few Rake tasks to generate Ruby Interface (RBI) files for dynami | |||
|
|||
``` | |||
# -- Gemfile -- | |||
|
|||
# In the default group (same as sorbet-runtime) because of "Features Provided at Runtime" below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've heard some people don't use sorbet-runtime
in the production environment, so I think this part may actually be misleading. Maybe we should say "the group including production environment"
README.md
Outdated
@@ -148,6 +146,22 @@ Since mailing action methods is based on instance methods defined in a mailer cl | |||
- If not, all the params in the mailing action method will be T.untyped. | |||
- For return type though, the mailing action method will return `ActionMailer::MessageDelivery` instead of the return type of the instance method. | |||
|
|||
## Features Provided at Runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should change the current "Type-checking Rails code" to "Static RBI Generation", and move the documentation of run-time features there to this section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's needed for this section to work properly is running rake rails_rbi:custom
, which will copy the rbi for the provided methods.
Updated per comments, please review.
I don't understand this comment. Is it something you can add in a future PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :-) I suggested a title so that it's parallel with the "Static RBI Generation" title
README.md
Outdated
@@ -148,6 +147,23 @@ Since mailing action methods is based on instance methods defined in a mailer cl | |||
- If not, all the params in the mailing action method will be T.untyped. | |||
- For return type though, the mailing action method will return `ActionMailer::MessageDelivery` instead of the return type of the instance method. | |||
|
|||
### Features Provided at Runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Features Provided at Runtime | |
## Runtime Features |
Btw, please remove |
Sure, I'll add it later. I'll attempt to explain it still: simply put we need to copy some RBI so that the sorbet knows the signature of the runtime methods added. It's through running the rake task
|
Thanks Harry, changes made. |
I couldn't find any docs on this, so I'm attempting to write some. I'm not at all sure this is correct, but will at least start a conversation. Thanks!