-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Update "Active Record Associations" guide [ci skip] #31316
Update "Active Record Associations" guide [ci skip] #31316
Conversation
(@rails-bot has picked a reviewer for you, use r? to override) |
Merely saying "Update" in the commit message doesn't cut it for me. Please elaborate what you've changed and why. |
a1fe3fc
to
6347fe8
Compare
What's wrong about this? |
6347fe8
to
8cc7c3c
Compare
@kaspth Thanks for the review. looks like I was misunderstanding the sentence |
guides/source/association_basics.md
Outdated
The `collection.find` method finds objects within the collection. It uses the same syntax and options as `ActiveRecord::Base.find`. It also adds the additional condition that the object must be in the collection. | ||
The `collection.find` method finds objects within the collection. It uses the same syntax and options as | ||
[`ActiveRecord::Base.find`](http://api.rubyonrails.org/classes/ActiveRecord/FinderMethods.html#method-i-find). | ||
It also adds the additional condition that the object must be in the collection. |
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.
The
collection.find
method finds objects within the collection. [...] It also adds the additional condition that the object must be in the collection.
This seems totally redundant to me; I think you were right to remove it initially.
I think what it's trying to say is that collection.find
behaves identically to ActiveRecord::Base.find
, except that the query will be scoped to the collection. I think that's clear enough from the first two sentences, though.
WDYT @kaspth?
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.
Yes, the line is totally redundant and can be removed. @bogdanvlviv has expressed interest in upping his contributions, so I'm badgering him to explain his understanding and come up with better arguments for it.
In other words: the line shouldn't be removed because "it's wrong" (it ain't), but it should be removed because it's redundant. Bogdan, you know what to do 😊
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.
Apologies, I didn't recognise the Socratic method at work here. 😁
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.
Done.
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.
@eugeneius pretty hidden, so no worries! 😊
@bogdanvlviv cool 👍
- Make all `ActiveRecord::Base.find` as link - Remove redundant sentences "It also adds the additional condition that the object must be in the collection."
8cc7c3c
to
ff214c3
Compare
Make all
ActiveRecord::Base.find
as linkRemove "It also adds the additional condition that the object must be in the collection."sentence for
collection.where
since it isn't correct statement.Remove the sentence for
collection.find
for consistency with others.Remove redundant sentences
"It also adds the additional condition that the object must be in the collection."