Skip to content
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

Closed
mrj opened this issue Jul 31, 2015 · 8 comments
Labels

Comments

@mrj
Copy link
Contributor

mrj commented Jul 31, 2015

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.

@al2o3cr
Copy link
Contributor

al2o3cr commented Aug 4, 2015

@mrj - The has_one example appears to have Ruby code-ish text inside a SQL literal. Wat.

@mrj
Copy link
Contributor Author

mrj commented Aug 4, 2015

Ha, didn't notice that before.

@rails-bot
Copy link

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

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 4-2-stable, 4-1-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

@mrj
Copy link
Contributor Author

mrj commented Dec 23, 2015

These five doc errors are still present in master.

@rafaelfranca
Copy link
Member

Please send a PR fixing those errors.

@davidwessman
Copy link

Should you delete all the examples or write new ones with the owner object as parameter instead?

@mrj
Copy link
Contributor Author

mrj commented Jan 3, 2016

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.

@rails-bot
Copy link

This issue has been automatically closed because of inactivity.

If you can still reproduce this error on the 4-2-stable, 4-1-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants