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
[RF DOCS] Active Record Basics Guide [ci-skip] #51226
[RF DOCS] Active Record Basics Guide [ci-skip] #51226
Conversation
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Guilherme Silva <guilherme.gss@outlook.com.br>
Co-authored-by: Mina Mikhail <mina@fightingtheboss.com>
Co-authored-by: Mina Mikhail <mina@fightingtheboss.com>
Thanks for bringing this up. I do think it should be explained somewhere in the guides, as it is practical thing many applications adopt.
This is a handy command to mention too 👍 Looks like it prompts you to choose what you want to do in case of conflict and clearly marks the conflict:
|
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.
Really great updates all around @bhumi1102! I had a few bits of feedback below on a final quick review, but otherwise this lgtm.
Co-authored-by: Bruno Prieto <brunoprietog@hey.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Sorry for commenting so late again, but do you think it would be good to add something about concerns here as well? Besides the getting started guide, I haven't seen it mentioned. Although concerns are also used in controllers, maybe it would be useful to show how useful they can be for organizing models, both writing concerns for a particular one that is specific to a model and concerns that are intended for reuse in multiple models. Very inspired by the Good Concerns article on the 37signals blog. Maybe it's a bit out of scope, but honestly, this is so poorly documented that I think it's the main reason why services, interactors, commands, mutators or other types of patterns emerge. It just started to become a little clearer with this great series of articles. |
@carlosantoniodasilva I've addressed the final review comments. Last commit does the wraps columns. Ready to merge! |
Good point. I've added a follow-on task in basecamp to document Concerns in general. This will span multiple guides likely. |
author:string`. This creates both `/app/models/book.rb` and | ||
`/db/migrate/20240220143807_create_books.rb` files. | ||
|
||
### Creating Namespaced Models |
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.
This section switches to Product
instead of Book
for the example. Should it be changed to Book
too?
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.
@asavageiv sure, would you like to send a PR with the change?
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.
Sure
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.
Add more code examples and update existing examples to be more consistent across the board. Make the connection between Active Record and Active Model clearer. Update Intro language to be more friendly, less jargon-y, clearly explain terms like ORM. Expand some sections like how to generate namespaces models. Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Motivation / Background
This Pull Request has been created to update and improve the Active Record Basics guide.
Detail
Testing
Run
guides:generate
andguides:lint
locally and review the generated guide.Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]