Skip to content

Commit 55beb7d

Browse files
Fix typos (#5938)
* Fix typos in code comments * Fix typos in changelog * Fix typos in test descriptions * Fix typo in a test helper method name
1 parent 8d3c92f commit 55beb7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+78
-78
lines changed

.evergreen/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ functions:
3939
git submodule update --init --recursive
4040
4141
"create expansions":
42-
# Make an evergreen exapanstion file with dynamic values
42+
# Make an evergreen expansion file with dynamic values
4343
- command: shell.exec
4444
params:
4545
working_dir: "src"

CHANGELOG.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ For instructions on upgrading to newer versions, visit
105105

106106
* \#4005 Fixed inclusion of mongoid with Rails components that don't have the Rails environment.
107107

108-
* \#3993 Fixes issue where `dup`/`clone` fails for embedded documents that use store_as without using Mongoid::Atributes::Dynamic
108+
* \#3993 Fixes issue where `dup`/`clone` fails for embedded documents that use store_as without using Mongoid::Attributes::Dynamic
109109

110110
* \#3991 Fixed embedded documents not flagging as changed after calling #changed? and modifying the
111111
child elements.
@@ -798,7 +798,7 @@ child elements.
798798
Band.where(name: "Placebo").unset(:members, :origin)
799799

800800
* \#2669 Passing a block to `Criteria#new` now properly sends the
801-
block through to the model's contructor. (Arthur Neves)
801+
block through to the model's constructor. (Arthur Neves)
802802

803803
* \#2667 `exists?` no longer hits the database in cases where we have
804804
the necessary information in memory.
@@ -1200,7 +1200,7 @@ child elements.
12001200

12011201
* \#2571 Remove blank error message from locales. (Jordan Elver)
12021202

1203-
* \#2568 Fix uniqueness validation for lacalized fields when a scope is also
1203+
* \#2568 Fix uniqueness validation for localized fields when a scope is also
12041204
provided.
12051205

12061206
* \#2552 Ensure `InvalidPath` errors are raised when embedded documents try to
@@ -1609,7 +1609,7 @@ child elements.
16091609

16101610
Band.first.touch
16111611

1612-
Update a specific time field along with the udpated_at.
1612+
Update a specific time field along with the updated_at.
16131613

16141614
Band.first.touch(:founded)
16151615

@@ -1728,7 +1728,7 @@ child elements.
17281728
# { "name" => "foo", "my_preferences" => [{ "value" => "ok" }]}
17291729

17301730
* \#1806 `Model.find_or_create_by` and `Model.find_or_initialize_by` can now
1731-
take documents as paramters for belongs_to relations.
1731+
take documents as parameters for belongs_to relations.
17321732

17331733
person = Person.first
17341734
Game.find_or_create_by(person: person)
@@ -2506,7 +2506,7 @@ child elements.
25062506
* \#2038 Allow inverse relations to be determined by foreign keys alone
25072507
if defined on both sides, not just an inverse_of declaration.
25082508

2509-
* \#2023 Allow serilialization of dynamic types that conflict with core
2509+
* \#2023 Allow serialization of dynamic types that conflict with core
25102510
Ruby methods to still be serialized.
25112511

25122512
* \#2008 Presence validation should hit the db to check validity if the
@@ -2611,7 +2611,7 @@ child elements.
26112611
had the foreign key link persisted.
26122612

26132613
* \#1820 Destroying embedded documents in an embeds_many should also
2614-
removed the document from the underlying _uncoped target and reindex
2614+
removed the document from the underlying _unscoped target and reindex
26152615
the relation.
26162616

26172617
* \#1814 Don't cascade callbacks on after_initialize.
@@ -3059,7 +3059,7 @@ child elements.
30593059
key without error.
30603060

30613061
* \#1350, \#1351 Fixed errors in the string conversions of double quotes and
3062-
tilde when paramterizing keys.
3062+
tilde when parametrizing keys.
30633063

30643064
* \#1349 Mongoid documents should not blow up when including Enumerable.
30653065
(Jonas Nicklas)

lib/mongoid/association/embedded/embeds_many/proxy.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def integrate(document)
484484
#
485485
# @return [ Criteria | Object ] A Criteria or return value from the target.
486486
#
487-
# TODO: make sure we are consistingly using respond_to_missing
487+
# TODO: make sure we are consistently using respond_to_missing
488488
# anywhere we define method_missing.
489489
# rubocop:disable Style/MissingRespondToMissing
490490
ruby2_keywords def method_missing(name, *args, &block)

lib/mongoid/association/referenced/has_many/enumerable.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def first(limit = nil)
253253
# Initialize the new enumerable either with a criteria or an array.
254254
#
255255
# @example Initialize the enumerable with a criteria.
256-
# Enumberable.new(Post.where(:person_id => id))
256+
# Enumerable.new(Post.where(:person_id => id))
257257
#
258258
# @example Initialize the enumerable with an array.
259259
# Enumerable.new([ post ])

lib/mongoid/association/referenced/has_many/proxy.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def delete(document)
160160
# @example Delete all documents in the association.
161161
# person.posts.delete_all
162162
#
163-
# @example Conditonally delete all documents in the association.
163+
# @example Conditionally delete all documents in the association.
164164
# person.posts.delete_all({ :title => "Testing" })
165165
#
166166
# @param [ Hash ] conditions Optional conditions to delete with.
@@ -462,7 +462,7 @@ def cascade!(document)
462462
#
463463
# @return [ Criteria | Object ] A Criteria or return value from the target.
464464
#
465-
# TODO: make sure we are consistingly using respond_to_missing
465+
# TODO: make sure we are consistently using respond_to_missing
466466
# anywhere we define method_missing.
467467
# rubocop:disable Style/MissingRespondToMissing
468468
ruby2_keywords def method_missing(name, *args, &block)
@@ -512,7 +512,7 @@ def persistable?
512512
# @example Delete all documents in the association.
513513
# person.posts.delete_all
514514
#
515-
# @example Conditonally delete all documents in the association.
515+
# @example Conditionally delete all documents in the association.
516516
# person.posts.delete_all({ :title => "Testing" })
517517
#
518518
# @param [ Hash ] conditions Optional conditions to delete with.

lib/mongoid/atomic/modifiers.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def add_operation(mods, field, value)
119119
end
120120

121121
# Adds or appends an array operation with the $each specifier used
122-
# in conjuction with $push.
122+
# in conjunction with $push.
123123
#
124124
# @example Add the operation.
125125
# modifications.add_operation(mods, field, value)

lib/mongoid/attributes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def read_attribute_before_type_cast(name)
137137
# @param [ String | Symbol ] name The name of the attribute to remove.
138138
#
139139
# @raise [ Errors::ReadonlyAttribute ] If the field cannot be removed due
140-
# to being flagged as reaodnly.
140+
# to being flagged as readonly.
141141
def remove_attribute(name)
142142
validate_writable_field_name!(name.to_s)
143143
as_writable_attribute!(name) do |access|

lib/mongoid/config.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ module Config
166166
#
167167
# Setting this flag to true restores the pre-9.0 behavior, where callbacks
168168
# for embedded documents are called. This may lead to stack overflow errors
169-
# if there are more than cicrca 1000 embedded documents in the root
169+
# if there are more than circa 1000 embedded documents in the root
170170
# document's dependencies graph.
171171
# See https://jira.mongodb.org/browse/MONGOID-5658 for more details.
172172
option :around_callbacks_for_embeds, default: false

lib/mongoid/contextual/aggregable/memory.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def min(field = nil)
9090
# @example Get the sum for the provided block.
9191
# aggregable.sum(&:likes)
9292
#
93-
# @param [ Symbol | Numeric ] field The field to sum, or the intial
93+
# @param [ Symbol | Numeric ] field The field to sum, or the initial
9494
# value of the sum when a block is given.
9595
#
9696
# @return [ Numeric ] The sum value.

lib/mongoid/contextual/mongo.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def count(options = {}, &block)
8585
# Get the estimated number of documents matching the query.
8686
#
8787
# Unlike count, estimated_count does not take a block because it is not
88-
# traditionally defined (with a block) on Enumarable like count is.
88+
# traditionally defined (with a block) on Enumerable like count is.
8989
#
9090
# @example Get the estimated number of matching documents.
9191
# context.estimated_count
@@ -1018,7 +1018,7 @@ def demongoize_hash(klass, hash)
10181018
next
10191019
end
10201020

1021-
# does the key represent an emebedded relation on the document?
1021+
# does the key represent an embedded relation on the document?
10221022
aliased_name = klass.aliased_associations[key] || key
10231023
if (assoc = klass.relations[aliased_name])
10241024
case value

lib/mongoid/criteria.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def ==(other)
8888
# and finds one or many documents for the provided _id values.
8989
#
9090
# If this method is given a block, it delegates to +Enumerable#find+ and
91-
# returns the first document of those found by the current Crieria object
91+
# returns the first document of those found by the current Criteria object
9292
# for which the block returns a truthy value.
9393
#
9494
# Note that the "default proc" argument of Enumerable is not specially
@@ -99,7 +99,7 @@ def ==(other)
9999
# a nested array. Each array will be flattened.
100100
#
101101
# @example Finds a document by its _id, invokes Findable#find.
102-
# critera.find("1234")
102+
# criteria.find("1234")
103103
#
104104
# @example Finds the first matching document using a block, invokes Enumerable#find.
105105
# criteria.find { |item| item.name == "Depeche Mode" }
@@ -364,7 +364,7 @@ def empty_and_chainable?
364364
!!@none
365365
end
366366

367-
# Overriden to include _type in the fields.
367+
# Overridden to include _type in the fields.
368368
#
369369
# @example Limit the fields returned from the database.
370370
# Band.only(:name)
@@ -398,7 +398,7 @@ def read(value = nil)
398398
end
399399
end
400400

401-
# Overriden to exclude _id from the fields.
401+
# Overridden to exclude _id from the fields.
402402
#
403403
# @example Exclude fields returned from the database.
404404
# Band.without(:name)
@@ -414,7 +414,7 @@ def without(*args)
414414
# Returns true if criteria responds to the given method.
415415
#
416416
# @example Does the criteria respond to the method?
417-
# crtiteria.respond_to?(:each)
417+
# criteria.respond_to?(:each)
418418
#
419419
# @param [ Symbol ] name The name of the class method on the +Document+.
420420
# @param [ true | false ] include_private Whether to include privates.
@@ -483,8 +483,8 @@ def where(*args)
483483
# Historically this method required exactly one argument.
484484
# As of https://jira.mongodb.org/browse/MONGOID-4804 it also accepts
485485
# zero arguments.
486-
# The underlying where implemetation that super invokes supports
487-
# any number of arguments, but we don't presently allow mutiple
486+
# The underlying where implementation that super invokes supports
487+
# any number of arguments, but we don't presently allow multiple
488488
# arguments through this method. This API can be reconsidered in the
489489
# future.
490490
if args.length > 1

lib/mongoid/criteria/queryable/expandable.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module Expandable
2323
#
2424
# The following parameter forms are accepted:
2525
#
26-
# - field is a string or symbol; value is the field query expresision
26+
# - field is a string or symbol; value is the field query expression
2727
# - field is a Key instance; value is the field query expression
2828
# - field is a string corresponding to a MongoDB operator; value is
2929
# the operator value expression.

lib/mongoid/criteria/scopable.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def remove_scoping(other)
6666
self
6767
end
6868

69-
# Forces the criteria to be scoped, unless its inside an unscoped block.
69+
# Forces the criteria to be scoped, unless it's inside an unscoped block.
7070
#
7171
# @example Force the criteria to be scoped.
7272
# criteria.scoped(skip: 10)

lib/mongoid/errors/unregistered_class.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Errors
66
# class in a polymorphic association, but the class has not previously
77
# been registered by resolver that was used for the query.
88
#
9-
# Here's an exammple:
9+
# Here's an example:
1010
#
1111
# class Department
1212
# include Mongoid::Document

lib/mongoid/factory.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Mongoid
55
module Factory
66
extend self
77

8-
# A helper class for instantiating a model using either it's type
8+
# A helper class for instantiating a model using either its type
99
# class directly, or via a type class specified via a discriminator
1010
# key.
1111
#
@@ -99,7 +99,7 @@ def instantiate_with_type(execute_callbacks)
9999
)
100100
end
101101

102-
# Retreive the `Class` instance of the requested type, either by finding it
102+
# Retrieve the `Class` instance of the requested type, either by finding it
103103
# in the `klass` discriminator mapping, or by otherwise finding a
104104
# Document model with the given name.
105105
#

lib/mongoid/fields.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def options
324324
# @param [ String ] key The key used to search the association tree.
325325
# @param [ Hash ] fields The fields to begin the search with.
326326
# @param [ Hash ] associations The associations to begin the search with.
327-
# @param [ Hash ] aliased_associations The alaised associations to begin
327+
# @param [ Hash ] aliased_associations The aliased associations to begin
328328
# the search with.
329329
# @param &block The block.
330330
# @yieldparam [ Symbol ] The current method.

lib/mongoid/findable.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def exists?(id_or_conditions = :none)
147147
# during query construction.
148148
#
149149
# If this method is given a block, it delegates to +Enumerable#find+ and
150-
# returns the first document of those found by the current Crieria object
150+
# returns the first document of those found by the current Criteria object
151151
# for which the block returns a truthy value. If both a block and ids are
152152
# given, the block is ignored and the documents for the given ids are
153153
# returned. If a block and a Proc are given, the method delegates to

lib/mongoid/matcher.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module Matcher
4545
# @return [ Object | Array ] Field value or values.
4646
module_function def extract_attribute(document, key)
4747
# The matcher system will wind up sending atomic values to this as well,
48-
# when attepting to match more complex types. If anything other than a
48+
# when attempting to match more complex types. If anything other than a
4949
# Document or a Hash is given, we'll short-circuit the logic and just
5050
# return an empty array.
5151
return [] unless document.is_a?(Hash) || document.is_a?(Document)

lib/mongoid/persistence_context.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def context_store
292292
# Get the persistence context for a given object from the thread local
293293
# storage.
294294
#
295-
# @param [ Object ] object Object to get the persistance context for.
295+
# @param [ Object ] object Object to get the persistence context for.
296296
#
297297
# @return [ Mongoid::PersistenceContext | nil ] The persistence context
298298
# for the object if previously stored, otherwise nil.
@@ -305,7 +305,7 @@ def get_context(object)
305305
# Store persistence context for a given object in the thread local
306306
# storage.
307307
#
308-
# @param [ Object ] object Object to store the persistance context for.
308+
# @param [ Object ] object Object to store the persistence context for.
309309
# @param [ Mongoid::PersistenceContext ] context Context to store
310310
#
311311
# @api private

lib/mongoid/railtie.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def self.rescue_responses
9494
end
9595

9696
# Rails runs all initializers first before getting into any generator
97-
# code, so we have no way in the intitializer to know if we are
97+
# code, so we have no way in the initializer to know if we are
9898
# generating a mongoid.yml. So instead of failing, we catch all the
9999
# errors and print them out.
100100
def handle_configuration_error(e)

lib/mongoid/stateful.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def flagged_for_destroy?
7676
alias :marked_for_destruction? :flagged_for_destroy?
7777
alias :_destroy :flagged_for_destroy?
7878

79-
# Returns true if the +Document+ has been succesfully destroyed, and false
79+
# Returns true if the +Document+ has been successfully destroyed, and false
8080
# if it hasn't. This is determined by the variable @destroyed and NOT
8181
# by checking the database.
8282
#

lib/mongoid/threaded.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module Threaded
4141
# given, and the variable does not already exist, the return value of the
4242
# block will be set as the value of the variable before returning it.
4343
#
44-
# It is very important that applications (and espcially Mongoid)
44+
# It is very important that applications (and especially Mongoid)
4545
# use this method instead of Thread#[], since Thread#[] is actually for
4646
# fiber-local variables, and Mongoid uses Fibers as an implementation
4747
# detail in some callbacks. Putting thread-local state in a fiber-local

lib/rails/generators/mongoid/config/templates/mongoid.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,15 @@ development:
135135
driver_options:
136136
# When this flag is off, an aggregation done on a view will be executed over
137137
# the documents included in that view, instead of all documents in the
138-
# collection. When this flag is on, the view fiter is ignored.
138+
# collection. When this flag is on, the view filter is ignored.
139139
# broken_view_aggregate: true
140140

141141
# When this flag is set to false, the view options will be correctly
142142
# propagated to readable methods.
143143
# broken_view_options: true
144144

145145
# When this flag is set to true, the update and replace methods will
146-
# validate the paramters and raise an error if they are invalid.
146+
# validate the parameters and raise an error if they are invalid.
147147
# validate_update_replace: false
148148

149149

perf/benchmark_ips.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def preferences
215215
end
216216

217217
# IMPROVEME:
218-
# the same problem here as was metioned above.
218+
# the same problem here as was mentioned above.
219219
bm.report("#find") do
220220
person.posts.find(person_post_id)
221221
end

spec/integration/associations/belongs_to_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def quarantine(context, polymorphic:, dept_aliases:, team_aliases:)
1515
# Have to eval this, because otherwise we get syntax errors when defining a class
1616
# inside a method.
1717
#
18-
# I know the scissors are sharp! But I want to run with them anwyay!
18+
# I know the scissors are sharp! But I want to run with them anyway!
1919
Object.class_eval <<-RUBY
2020
class SandboxManager; include Mongoid::Document; end
2121
class SandboxDepartment; include Mongoid::Document; end

0 commit comments

Comments
 (0)