-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
The RDoc for scopes in association declarations wrongly includes examples with non-owner parameters #21083
Comments
@mrj - The |
Ha, didn't notice that before. |
This issue has been automatically marked as stale because it has not been commented on for at least The resources of the Rails team are limited, and so we are asking for your help. If you can still reproduce this error on the Thank you for all your contributions. |
These five doc errors are still present in master. |
Please send a PR fixing those errors. |
Should you delete all the examples or write new ones with the |
The examples should cover the range of possibilities, each explained in the text. I've been delaying making the PR until I confirm whether the blocks are executed in the context of the owner objects, meaning that owner-object parameters are unnecessary. |
This issue has been automatically closed because of inactivity. If you can still reproduce this error on the Thank you for all your contributions. |
The second parameter of an association declaration can be a callable scope, which either takes no parameter or takes the assocation's owner object as a parameter.
However for each association type, the documentation gives an example of a scope with a non-owner parameter: belongs_to, has_and_belongs_to_many, has_many, and has_one.
These examples should be deleted, and references added back to the "Accessing the owner object" section.
Once confirmed, I can work up a patch.
The text was updated successfully, but these errors were encountered: