Skip to content

Commit 14f6f69

Browse files
p-mongop
andauthored
Mongoid operates on documents, not records (#5324)
Co-authored-by: Oleg Pudeyev <[email protected]>
1 parent 09f30b7 commit 14f6f69

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

docs/additional-resources.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Screencasts
2323
<https://www.youtube.com/watch?v=L0RqU2MdqXU>`_
2424

2525
An overview of Mongoid, by Ryan Bates including the basics
26-
of setting up an app, querying for records, adding embedded
26+
of setting up an app, querying for documents, adding embedded
2727
associations, overriding the id, and more.
2828

2929
- `Ruby on Rails Web Services and Integration with MongoDB, Week 3: Mongoid

docs/reference/associations.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,9 +1077,9 @@ documents which satisfy the scope condition.. The scope may be either:
10771077

10781078
.. note::
10791079

1080-
Mongoid's syntax for scoped association differs from that of Active Record.
1080+
Mongoid's syntax for scoped association differs from that of ActiveRecord.
10811081
Mongoid uses the ``:scope`` keyword argument for consistency with other
1082-
association options, whereas in Active Record the scope is a positional
1082+
association options, whereas in ActiveRecord the scope is a positional
10831083
argument.
10841084

10851085

@@ -1233,8 +1233,8 @@ to be deleted. The options are as follows:
12331233
- ``:restrict_with_exception``: ``raise`` an error if the child is not empty.
12341234
- ``:restrict_with_error``: Cancel operation and return false if the child is not empty.
12351235

1236-
If no ``:dependent`` option is provided, deleting the parent record leaves the child record unmodified
1237-
(in other words, the child record continues to reference the now deleted parent record via the foreign key field).
1236+
If no ``:dependent`` option is provided, deleting the parent document leaves the child document unmodified
1237+
(in other words, the child document continues to reference the now deleted parent document via the foreign key field).
12381238
The child may become orphaned if it is ordinarily only referenced via the parent.
12391239

12401240
.. code-block:: ruby
@@ -1620,7 +1620,7 @@ with, and is useful for developers of extensions to Mongoid.
16201620
* - ``Association#name``
16211621
- Returns the association name.
16221622
* - ``Association#options``
1623-
- Returns self, for API compatibility with Active Record.
1623+
- Returns self, for API compatibility with ActiveRecord.
16241624
* - ``Association#order``
16251625
- Returns the custom sorting options on the association.
16261626
* - ``Association#polymorphic?``

lib/config/locales/en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ en:
566566
version 3.6 or don't attempt to use sessions with older server versions."
567567
too_many_nested_attribute_records:
568568
message: "Accepting nested attributes for %{association} is limited
569-
to %{limit} records."
569+
to %{limit} documents."
570570
summary: "More documents were sent to be processed than the allowed
571571
limit."
572572
resolution: "The limit is set as an option to the macro, for example:

lib/mongoid/changeable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def changes
6262

6363
# Call this method after save, so the changes can be properly switched.
6464
#
65-
# This will unset the memoized children array, set new record to
65+
# This will unset the memoized children array, set new record flag to
6666
# false, set the document as validated, and move the dirty changes.
6767
#
6868
# @example Move the changes to previous.

lib/mongoid/errors/too_many_nested_attribute_records.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Mongoid
44
module Errors
55

6-
# This error is raised when trying to create set nested records above the
6+
# This error is raised when trying to create set nested documents above the
77
# specified :limit
88
#
99
# @example Create the error.

lib/mongoid/touchable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module InstanceMethods
1919
#
2020
# @param [ Symbol ] field The name of an additional field to update.
2121
#
22-
# @return [ true/false ] false if record is new_record otherwise true.
22+
# @return [ true/false ] false if document is new_record otherwise true.
2323
def touch(field = nil)
2424
return false if _root.new_record?
2525
current = Time.configured.now

lib/mongoid/validatable/uniqueness.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Validatable
1616
# end
1717
#
1818
# It is also possible to limit the uniqueness constraint to a set of
19-
# records matching certain conditions:
19+
# documents matching certain conditions:
2020
# class Person
2121
# include Mongoid::Document
2222
# field :title

spec/mongoid/errors/too_many_nested_attribute_records_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
it "contains the problem in the message" do
1414
expect(error.message).to include(
15-
"Accepting nested attributes for favorites is limited to 5 records."
15+
"Accepting nested attributes for favorites is limited to 5 documents."
1616
)
1717
end
1818

0 commit comments

Comments
 (0)