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

[ci skip] fix the collection.clear guide #20421

Merged

Conversation

repinel
Copy link
Member

@repinel repinel commented Jun 3, 2015

Improve the guide about has_many collection.clear to indicate the behavior for each dependent strategy according to collection.delete_all.

Based on #17179, I changed the collection.delete docs to also clarify the default strategy for each hm and hm:t associations.

Fixes #20170.

# keys to <tt>NULL</tt>. For, +has_many+ <tt>:through</tt>, the default
# strategy is +delete_all+.
# Deletes the +records+ supplied from the collection according to the strategy
# specified by the +:dependent+ option. If no +:dependent+ option is given,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it needs to use <tt> for symbols

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo "+:dependent+" | rdoc --pipe still outputs <p><code>:dependent</code></p>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For delete_all too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, for +:delete_all+ using the same idea you get <p><code>:delete_all</code></p>.

Improve the guide about `has_many` `collection.clear` to indicate
the behavior for each dependent strategy according to
`collection.delete_all`.

Based on rails#17179, I changed the `collection.delete` docs to also
clarify the default strategy for each `hm` and `hm:t` associations.

Fixes rails#20170.
@repinel repinel force-pushed the fix-clear-guides-and-related-api-docs branch from 77b0241 to efa1648 Compare June 3, 2015 03:17
rafaelfranca added a commit that referenced this pull request Jun 3, 2015
…pi-docs

[ci skip] fix the `collection.clear` guide
@rafaelfranca rafaelfranca merged commit 814a994 into rails:master Jun 3, 2015
rafaelfranca added a commit that referenced this pull request Jun 3, 2015
…pi-docs

[ci skip] fix the `collection.clear` guide
@repinel repinel deleted the fix-clear-guides-and-related-api-docs branch June 3, 2015 03:47
@repinel
Copy link
Member Author

repinel commented Jun 3, 2015

@rafaelfranca Thanks for reviewing!

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

Successfully merging this pull request may close these issues.

Wrong documentation (or implementation) of has_many clear
2 participants