-
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
Changes from 2 commits
a25eede
78083c9
8310a07
c3592be
85f7765
772600e
6b38408
b876e64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,31 +31,32 @@ | |||||
| ------------------- | ||||||
|
|
||||||
| To start using {+odm+} in an existing Sinatra application, you can follow | ||||||
| the same steps described in the | ||||||
| :ref:`Sinatra Quick Start <mongoid-quick-start-sinatra>` guide. | ||||||
|
|
||||||
| The following steps describe how to add {+odm+} to a Sinatra application: | ||||||
| the following steps: | ||||||
|
|
||||||
| 1. Add the ``mongoid`` dependency to your application's ``Gemfile``. | ||||||
|
|
||||||
| #. Create a ``config/mongoid.yml`` configuration file and specify your | ||||||
| connection target. | ||||||
| connection target, as shown in the | ||||||
| :ref:`mongoid-quick-start-sinatra-connect-to-mongodb` step of the | ||||||
| Quick Start guide. | ||||||
|
|
||||||
| #. Create an application file and load your configuration file. | ||||||
| #. Create an application file and load your configuration file, as shown | ||||||
| in the :ref:`mongoid-quick-start-sinatra-view-data` step of the Quick | ||||||
| Start guide. | ||||||
|
|
||||||
| #. Create {+odm+} models. | ||||||
| #. Create {+odm+} models to interact with your data. | ||||||
|
|
||||||
| Rails Application | ||||||
| ----------------- | ||||||
|
|
||||||
| You can add {+odm+} to an existing Rails application to run alongside | ||||||
| other ActiveRecord adapters. To use a combination of adapters, you | ||||||
| other Active Record adapters. To use a combination of adapters, you | ||||||
| can add the ``mongoid`` dependency and populate the configuration file | ||||||
| with your connection information to start using MongoDB in your | ||||||
| application. | ||||||
|
|
||||||
| To adapt an existing Rails application to use only {+odm+} instead of | ||||||
| ActiveRecord, you must make other configuration changes, as | ||||||
| Active Record, you must make other configuration changes, as | ||||||
| described in the following sections. | ||||||
|
|
||||||
| Modify Dependencies | ||||||
|
|
@@ -69,7 +70,8 @@ | |||||
| 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``. | ||||||
| RDBMS libraries listed in the ``Gemfile``, such as ``sqlite`` or | ||||||
| ``pg``. | ||||||
|
|
||||||
| Then, install the dependencies by running the following command: | ||||||
|
|
||||||
|
|
@@ -98,17 +100,11 @@ | |||||
| Modify Frameworks | ||||||
| ~~~~~~~~~~~~~~~~~ | ||||||
|
|
||||||
| Open the ``config/application.rb`` file and examine the contents. If it | ||||||
| requires all the components of Rails by including the ``require | ||||||
| 'rails/all'`` specification, change this to specify individual | ||||||
| frameworks. | ||||||
|
|
||||||
| 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>`. | ||||||
|
|
||||||
| The following code is a sample ``config/application.rb`` file that | ||||||
| demonstrates how to specify individual frameworks instead of using ``rails/all``: | ||||||
| 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 | ||||||
|
||||||
| for each Rails component, as shown the following sample | |
| for each Rails component, as shown in the following sample |
Check failure on line 169 in source/add-existing.txt
GitHub Actions / TDBX Vale rules
[vale] reported by reviewdog 🐶
[MongoDB.NegativeWords] Use 'remove, delete' instead of the negative word 'destroy'.
Raw Output:
{"message": "[MongoDB.NegativeWords] Use 'remove, delete' instead of the negative word 'destroy'.", "location": {"path": "source/add-existing.txt", "range": {"start": {"line": 169, "column": 38}}}, "severity": "ERROR"}
Check failure on line 183 in source/add-existing.txt
GitHub Actions / TDBX Vale rules
[vale] reported by reviewdog 🐶
[MongoDB.NegativeWords] Use 'remove, delete' instead of the negative word 'destroy'.
Raw Output:
{"message": "[MongoDB.NegativeWords] Use 'remove, delete' instead of the negative word 'destroy'.", "location": {"path": "source/add-existing.txt", "range": {"start": {"line": 183, "column": 38}}}, "severity": "ERROR"}
Check failure on line 196 in source/add-existing.txt
GitHub Actions / TDBX Vale rules
[vale] reported by reviewdog 🐶
[MongoDB.NegativeWords] Use 'remove, delete' instead of the negative word 'destroy'.
Raw Output:
{"message": "[MongoDB.NegativeWords] Use 'remove, delete' instead of the negative word 'destroy'.", "location": {"path": "source/add-existing.txt", "range": {"start": {"line": 196, "column": 38}}}, "severity": "ERROR"}
Check failure on line 203 in source/add-existing.txt
GitHub Actions / TDBX Vale rules
[vale] reported by reviewdog 🐶
[MongoDB.ConciseTerms] 'must' is preferred over 'have to'.
Raw Output:
{"message": "[MongoDB.ConciseTerms] 'must' is preferred over 'have to'.", "location": {"path": "source/add-existing.txt", "range": {"start": {"line": 203, "column": 65}}}, "severity": "ERROR"}
Outdated
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."
Check failure on line 226 in source/add-existing.txt
GitHub Actions / TDBX Vale rules
[vale] reported by reviewdog 🐶
[MongoDB.Accessibility] Don't use language (such as 'normal') that defines people by their disability.
Raw Output:
{"message": "[MongoDB.Accessibility] Don't use language (such as 'normal') that defines people by their disability.", "location": {"path": "source/add-existing.txt", "range": {"start": {"line": 226, "column": 35}}}, "severity": "ERROR"}
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"