forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RF-DOCS]Active Record Associations Guide [ci-skip] (rails#52523)
* The images used to show the relationships of the different types of associations have both the table declarations, as well as a code sample, but the code sample is also in the guide. We could probably simplify the images by cutting off the code samples from them and leaving them in the guide code. * belongs_to section mentions bi-directional association and links to it within the same guide, but doesn't do the same for has_one and has_many, mentioned right after in the same paragraph. * There's a note about using bigint :supplier_id in the section between belongs_to and has_one, but up until that point it's always been using belongs_to in migrations... it's probably something that doesn't need to be in this area of the guide. * The has_many :through vs has_and_belongs_to_many section ends with a composite keys mention, we could link to the new guide there. * Associations between models with composite PKs may be simplified. * One example in bi-directional associations mentions Book belongs_to :writer, but then uses book.author a few lines below, which is incorrect. * STI section could be expanded, it's very useful in certain situations. * Add more info and make it clear * Group sections better * Amend the References section to be integrated with associations * Abstract and remove duplications for options and scopes Co-authored-by: Petrik de Heus <[email protected]> Co-authored-by: Rizwan Reza <[email protected]> Co-authored-by: Matheus Richard <[email protected]> Co-authored-by: Mike Stroming <[email protected]> Co-authored-by: Harriet Oughton <[email protected]>
- Loading branch information
1 parent
dd3f743
commit 69c86f9
Showing
10 changed files
with
2,297 additions
and
2,057 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6.16 KB
(92%)
guides/assets/images/association_basics/has_many_through.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-836 Bytes
(99%)
guides/assets/images/association_basics/has_one_through.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.