Skip to content

Commit 04985da

Browse files
Merge branch 'master' into set-resizable
2 parents 65ff395 + 85de452 commit 04985da

30 files changed

+838
-400
lines changed

CODE_OF_CONDUCT.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official email address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement through GitHub.
63+
All complaints will be reviewed and investigated promptly and fairly.
64+
65+
All community leaders are obligated to respect the privacy and security of the
66+
reporter of any incident.
67+
68+
## Enforcement Guidelines
69+
70+
Community leaders will follow these Community Impact Guidelines in determining
71+
the consequences for any action they deem in violation of this Code of Conduct:
72+
73+
### 1. Correction
74+
75+
**Community Impact**: Use of inappropriate language or other behavior deemed
76+
unprofessional or unwelcome in the community.
77+
78+
**Consequence**: A private, written warning from community leaders, providing
79+
clarity around the nature of the violation and an explanation of why the
80+
behavior was inappropriate. A public apology may be requested.
81+
82+
### 2. Warning
83+
84+
**Community Impact**: A violation through a single incident or series of
85+
actions.
86+
87+
**Consequence**: A warning with consequences for continued behavior. No
88+
interaction with the people involved, including unsolicited interaction with
89+
those enforcing the Code of Conduct, for a specified period of time. This
90+
includes avoiding interactions in community spaces as well as external channels
91+
like social media. Violating these terms may lead to a temporary or permanent
92+
ban.
93+
94+
### 3. Temporary Ban
95+
96+
**Community Impact**: A serious violation of community standards, including
97+
sustained inappropriate behavior.
98+
99+
**Consequence**: A temporary ban from any sort of interaction or public
100+
communication with the community for a specified period of time. No public or
101+
private interaction with the people involved, including unsolicited interaction
102+
with those enforcing the Code of Conduct, is allowed during this period.
103+
Violating these terms may lead to a permanent ban.
104+
105+
### 4. Permanent Ban
106+
107+
**Community Impact**: Demonstrating a pattern of violation of community
108+
standards, including sustained inappropriate behavior, harassment of an
109+
individual, or aggression toward or disparagement of classes of individuals.
110+
111+
**Consequence**: A permanent ban from any sort of public interaction within the
112+
community.
113+
114+
## Attribution
115+
116+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117+
version 2.1, available at
118+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
119+
120+
Community Impact Guidelines were inspired by
121+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
122+
123+
For answers to common questions about this code of conduct, see the FAQ at
124+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
125+
[https://www.contributor-covenant.org/translations][translations].
126+
127+
[homepage]: https://www.contributor-covenant.org
128+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
129+
[Mozilla CoC]: https://github.com/mozilla/diversity
130+
[FAQ]: https://www.contributor-covenant.org/faq
131+
[translations]: https://www.contributor-covenant.org/translations

docs/index.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Mongoid
66

77
.. default-domain:: mongodb
88

9-
Mongoid is the officially supported object-document mapper (ODM)
10-
for MongoDB in Ruby.
9+
Mongoid is the officially supported object-document mapper (ODM) for MongoDB in
10+
Ruby. To work with Mongoid from the command line using ``rails``-like tooling,
11+
the `railsmdb <https://github.com/mongodb/mongoid-railsmdb>`_ utility can be used.
1112

1213
.. toctree::
1314
:titlesonly:
@@ -21,6 +22,3 @@ for MongoDB in Ruby.
2122
contributing
2223
additional-resources
2324
ecosystem
24-
25-
26-
For documentation on Mongoid 3 and 4, see `<http://mongoid.github.io>`_.

docs/installation.txt

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,33 @@ To install the gem with bundler, include the following in your ``Gemfile``:
3232
Using Mongoid with a New Rails Application
3333
==========================================
3434

35-
When creating a new Rails application and wish to use Mongoid for
36-
data access, give the ``--skip-active-record`` flag to the ``rails new``
37-
command to avoid depending on and configuring ActiveRecord..
35+
By using the `railsmdb CLI <https://github.com/mongodb/mongoid-railsmdb>`_ a new
36+
Ruby on Rails application can be quickly generated using the same options as
37+
``rails new``, but configured to work with MongoDB:
38+
39+
.. code-block:: sh
40+
41+
railsmdb new my_new_rails_app
42+
43+
The ``rails`` CLI can also be used, however when creating a new Rails application
44+
and where Mongoid will be used for data access, provide the ``--skip-active-record``
45+
flag to the ``rails new`` command to avoid depending on and configuring ActiveRecord.
46+
47+
Additional examples can be found in the `tutorials <tutorials.html>`_.
3848

3949
Using Mongoid with an Existing Rails Application
4050
================================================
4151

42-
When converting an existing Rails application to use Mongoid for data access,
43-
the ``config/application.rb`` file needs to be updated to remove the
44-
``require 'rails/all'`` line and explicitly include the required frameworks
45-
(which could be all of the frameworks provided by Rails with the exception of
46-
ActiveRecord). Any references to ActiveRecord in files in the ``config``
47-
directory and in the models also need to be removed.
52+
Using the `railsmdb CLI <https://github.com/mongodb/mongoid-railsmdb>`_ an existing
53+
Rails application can easily be configured for use with Mongoid:
54+
55+
.. code-block:: sh
56+
57+
railsmdb setup
58+
59+
Converting an existing Rails application without using ``railsmdb`` can be done
60+
by updating the ``config/application.rb`` file to remove the ``require 'rails/all'``
61+
line and explicitly include the required frameworks (which could be all of the
62+
frameworks provided by Rails with the exception ofActiveRecord).
63+
Any references to ActiveRecord in files in the ``config`` directory and in the
64+
models also need to be removed.

docs/reference/configuration.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,8 @@ Place the following in one of environment configuration files, such as
541541

542542
.. note::
543543

544-
The ``log_level`` Mongoid `configuration option <configuration-options>`_
545-
is not used when Mongoid operates in a Rails application, because Mongoid
546-
inherits Rails' log level in this case.
544+
The ``log_level`` Mongoid configuration option is not used when Mongoid operates
545+
in a Rails application, because Mongoid inherits Rails' log level in this case.
547546

548547
To configure either Mongoid or driver logger differently from the Rails logger,
549548
use an initializer as follows:
@@ -590,8 +589,8 @@ Standalone
590589
----------
591590

592591
When not loaded in a Ruby on Rails application, Mongoid respects the
593-
``log_level`` top level `configuration option <configuration-options>`_.
594-
It can be given in the configuration file as follows:
592+
``log_level`` top level configuration option. It can be given in the
593+
configuration file as follows:
595594

596595
.. code-block:: yaml
597596

@@ -746,11 +745,11 @@ It may be desirable to further configure TLS options in your application, for
746745
example by enabling or disabling certain ciphers.
747746

748747
This can be done by setting TLS context hooks on the Ruby driver -- TLS context
749-
hooks are user-provided ``Proc``s that will be invoked before any TLS socket
748+
hooks are user-provided ``Proc``\(s) that will be invoked before any TLS socket
750749
connection in the driver and can be used to modify the underlying
751750
``OpenSSL::SSL::SSLContext`` object used by the socket.
752751

753-
To set TLS context hooks, add ``Proc``s to the ``Mongo.tls_context_hooks``
752+
To set TLS context hooks, add ``Proc``\(s) to the ``Mongo.tls_context_hooks``
754753
array. This can be done in an initializer. The example below adds a hook
755754
that only enables the "AES256-SHA" cipher.
756755

@@ -830,7 +829,7 @@ Client-Side Encryption
830829
When loading the configuration file, Mongoid permits the file to contain
831830
``BSON::Binary`` instances which are used for specifying ``keyId`` in
832831
the schema map for `client-side encryption
833-
<https://www.mongodb.com/docs/ruby-driver/current/reference/client-side-encryption/>`_,
832+
<https://www.mongodb.com/docs/ruby-driver/current/reference/in-use-encryption/client-side-encryption/>`_,
834833
as the following example shows:
835834

836835
.. code-block:: yaml

docs/reference/queries.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ examples.
11511151
If any of the ``_id`` values are not found in the database, the behavior of
11521152
``find`` depends on the value of the ``raise_not_found_error`` configuration
11531153
option. If the option is set to ``true``, ``find`` raises
1154-
``Mongoid::Errors::DocumentNotFound`` if any of the ``_id``s are not found.
1154+
``Mongoid::Errors::DocumentNotFound`` if any of the ``_id``\s are not found.
11551155
If the option is set to ``false`` and ``find`` is given a single ``_id`` to
11561156
find and there is no matching document, ``find`` returns ``nil``. If the
11571157
option is set to ``false`` and ``find`` is given an array of ids to find

docs/reference/sharding.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Shard keys can be declared on models using the ``shard_key`` macro:
3535
end
3636

3737
Note that in order to shard a collection, the collection must have an index
38-
that starts with the shard key. Mongoid provides `index management
39-
<indexes>`_ functionality, which the examples here take
38+
that starts with the shard key. Mongoid provides :ref:`index management
39+
<indexes>` functionality, which the examples here take
4040
advantage of.
4141

4242
Mongoid supports two syntaxes for declaring shard keys. The standard syntax

docs/reference/text-search.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ To perform text search with Mongoid, follow these steps:
3535
Defining Text Search Index
3636
--------------------------
3737

38-
Index definition through Mongoid is described in detail on the `indexes
39-
<indexes>`_ page. Text search indexes are described in detail
38+
Index definition through Mongoid is described in detail on the :ref:`indexes
39+
<indexes>` page. Text search indexes are described in detail
4040
under `text indexes <https://mongodb.com/docs/manual/core/index-text/>`_
4141
in the MongoDB manual. Below is an example definition of a Band model with
4242
a text index utilizing the description field:

0 commit comments

Comments
 (0)