-
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
Requesting documentation update #22240
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @matthewd (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
thanks for the PR @resource11 . I like the text change, and indeed think we should change the link. Our official docs are on http://api.rubyonrails.org/ . The AR::Base class docs are in http://api.rubyonrails.org/classes/ActiveRecord/Base.html , However as far as I can tell, there is no list of methods there. So I am not sure where else we can find that list. |
# ActiveRecord::Base. Since the association adds a method with that name to | ||
# its model, it will override the inherited method and break things. | ||
# For instance, +attributes+ and +connection+ would be bad choices for association names. | ||
# Don't create associations that have the same name as [instance methods](http://apidock.com/rails/ActiveRecord/Base) of |
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 official Rails code page for AR::Base would be: http://api.rubyonrails.org/classes/ActiveRecord/Base.html
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 dug into that link and found this:
http://api.rubyonrails.org/classes/ActiveRecord/Core.html#method-c-new, which pops the user to a list of public instance methods. Is this link sufficient?
Thanks for updating! Just so you know for the future, you can put |
Hmm, still not sure that's the right link to send people to. @rafaelfranca, thoughts? |
Thanks for the tip on the commit message. Looking forward to clarification on the correct link. |
The issue that I see about this, is that not all public methods are on the Base docs. as we have a lot of modules we include on Base. =/ |
Hmmm, could there at least be a list of 3-4 methods as an example to give more guidance with respect to names to avoid? Provide a breadcrumb trail to start the hunt for more info? |
I think a few examples, are a good idea. Like we have right now: |
^^ That information is a great thread for beginner users to pull! Can that be added to the documentation? |
# ActiveRecord::Base. Since the association adds a method with that name to | ||
# its model, it will override the inherited method and break things. | ||
# For instance, +attributes+ and +connection+ would be bad choices for association names. | ||
# Don't create associations that have the same name as [instance methods](http://api.rubyonrails.org/classes/ActiveRecord/Core.html#method-c-new) of |
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 link should be http://api.rubyonrails.org/classes/ActiveRecord/Core.html .
Also, @rafaelfranca is it OK to add markdown style links to these docs?
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.
Thanks for the clarification on the correct link, @arthurnn.
Considering the link is now listed on line 303, should lines 308 and 309 be removed?
== Auto-generated methods
See also Instance Public methods below for more details.
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 dont think we should remove that.
I think this is already a good improvement.
As a final change. can you:
- update the link, to remove
#method-c-new
from it.
Thanks
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.
Link updated (#method-c-new removed)
Thanks for the update. Can you squash your commits in one and I will merge that. Thanks again |
Update associations.rb Update associations.rb updates link to instance methods [ci skip]
57f07b1
to
79f2f0b
Compare
Commits squashed. Thanks, @arthurnn! |
thanks, and sorry for letting this get outside my radar. |
My pleasure! Glad this update got merged into the master branch. |
Hi there!
I made a suggested edit to the section that gives a 'word of warning' with respect to creating associations with the same name as ActiveRecord::Base instance methods. It'd be great to have a hyperlink to the list of ActiveRecord::Base instance methods so we can more easily know which association names we should avoid to minimize conflicts.
** I originally made this pull request on an incorrect branch, so I'm resubmitting now, comparing against the master branch.
Also, it was requested in the last pull request that I don't link to APIdock--since it is not the official documentation site-- and to use Rdoc to link internally. I'd be happy to link internally if I could find the actual location of where one can find the list of ActiveRecord::Base instance methods elsewhere within the documentation site. Can someone point me to that? It really would help provide clarification for the new-to-RoR crowd...
Thanks!