-
Notifications
You must be signed in to change notification settings - Fork 28
DOCSP-44647: add to existing app #55
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
DOCSP-44647: add to existing app #55
Conversation
✅ Deploy Preview for docs-mongoid ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
mongoKart
left a comment
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.
very solid. some suggestions and questions
source/add-existing.txt
Outdated
| ------------------- | ||
|
|
||
| To start using {+odm+} in an existing Sinatra application, you can follow | ||
| the same steps described in the |
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.
S:
| the same steps described in the | |
| the steps described in the |
source/add-existing.txt
Outdated
| #. Create a ``config/mongoid.yml`` configuration file and specify your | ||
| connection target. | ||
|
|
||
| #. Create an application file and load your configuration file. |
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.
Q: This is something users will know how 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.
I can link to the example in the QS
source/add-existing.txt
Outdated
| ----------------- | ||
|
|
||
| You can add {+odm+} to an existing Rails application to run alongside | ||
| other ActiveRecord adapters. To use a combination of adapters, you |
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.
S: looks to me like there's "Active Record" (the framework) and ActiveRecord (the module). Not sure which one is appropriate throughout this page.
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 think I'll replace with the spaced version, as I am using it the same way as Mongoid
source/add-existing.txt
Outdated
| gem 'mongoid' | ||
|
|
||
| To use {+odm+} as the *only* database adapter, remove or comment out any | ||
| RDBMS libraries such as ``sqlite`` or ``pg`` listed in the ``Gemfile``. |
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.
| RDBMS libraries such as ``sqlite`` or ``pg`` listed in the ``Gemfile``. | |
| RDBMS libraries listed in the ``Gemfile``, such as ``sqlite`` or ``pg``. |
source/add-existing.txt
Outdated
| To verify the contents of ``rails/all`` for Rails 7, see the | ||
| :github:`rails GitHub repository | ||
| </rails/rails/blob/7-0-stable/railties/lib/rails/all.rb>`. |
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.
S: tip admonition
| To verify the contents of ``rails/all`` for Rails 7, see the | |
| :github:`rails GitHub repository | |
| </rails/rails/blob/7-0-stable/railties/lib/rails/all.rb>`. | |
| .. tip:: rails/all Components | |
| To verify the contents of ``rails/all`` for Rails 7, see the | |
| :github:`rails GitHub repository. </rails/rails/blob/7-0-stable/railties/lib/rails/all.rb>` |
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 actually think we can just delete this note.
source/add-existing.txt
Outdated
| If your application already uses models, you must adjust them to | ||
| migrate from using ActiveRecord to {+odm+}. | ||
|
|
||
| ActiveRecord models derive from ``ApplicationRecord`` and do not have |
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.
| ActiveRecord models derive from ``ApplicationRecord`` and do not have | |
| ActiveRecord models derive from the ``ApplicationRecord`` class and do not have |
source/add-existing.txt
Outdated
| ActiveRecord models derive from ``ApplicationRecord`` and do not have | ||
| column definitions. {+odm+} models generally have no superclass but must | ||
| include the ``Mongoid::Document`` attribute. {+odm+} models usually | ||
| define fields explicitly. You can also use :ref:`dynamic fields | ||
| <mongoid-dynamic-fields>` instead of explicit field definitions. |
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.
S: is there a way to tie these four sentences together more? i'm guessing it's explaining how you need to change your models to use Mongoid, but it reads more like a list--in which case, maybe just make it an actual list?
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.
will workshop
source/add-existing.txt
Outdated
| has_many :comments, dependent: :destroy | ||
| end | ||
|
|
||
| Or, you can define the ``Post`` model by using dynamic fields, as shown |
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.
| Or, you can define the ``Post`` model by using dynamic fields, as shown | |
| Instead of using [blank], you can define the ``Post`` model by using dynamic fields, as shown |
source/add-existing.txt
Outdated
| {+odm+} does not use ActiveRecord migrations, because MongoDB does not | ||
| require a defined schema before you can store data. |
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.
S: maybe my own ignorance, but this feels tacked on to the previous section instead of a logical continuation, so maybe a note admonition would be useful. maybe even move to the next section (or delete altogether), since it makes this same point.
| {+odm+} does not use ActiveRecord migrations, because MongoDB does not | |
| require a defined schema before you can store data. | |
| .. note:: ActiveRecord Migrations | |
| {+odm+} does not use ActiveRecord migrations, because MongoDB does not | |
| require a defined schema before you can store data. |
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.
Deleted
source/quick-start-sinatra.txt
Outdated
| connect to a MongoDB cluster hosted on MongoDB Atlas, and perform | ||
| read and write operations on the data in your cluster. | ||
|
|
||
| To learn how to migrate an existing application to use {+odm+}, see the |
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.
S: my ear says you either migrate to Mongoid or adapt the application to use Mongoid, but not a combo
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 is meant to differentiate between starting a new app or integrating Mongoid into your existing app. I can make that more clear
mongoKart
left a comment
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.
looks great! a few small suggestions
| :ref:`Sinatra Quick Start <mongoid-quick-start-sinatra>` guide. | ||
|
|
||
| The following steps describe how to add {+odm+} to a Sinatra application: | ||
| the following steps: |
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.
S: change line to "perform the following steps:" or something similar to avoid double "follow"
source/add-existing.txt
Outdated
| Open the ``config/application.rb`` file and examine the contents. If the | ||
| file uses the ``require "rails/all"`` statement to load all Rails components, | ||
| delete this statement. You must add a separate ``require`` statement | ||
| for each Rails component, as shown the following sample |
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.
| for each Rails component, as shown the following sample | |
| for each Rails component, as shown in the following sample |
source/add-existing.txt
Outdated
| Even though {+odm+} supports a superset of Active Record associations, | ||
| the way that model references are stored in collections is different between | ||
| {+odm+} and ActiveRecord. | ||
| {+odm+} and Active Record. |
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.
S: "{+odm+} and Active Record store model references in collections differently."
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-44647
Staging - https://deploy-preview-55--docs-mongoid.netlify.app/add-existing/
Self-Review Checklist