Skip to content

MONGOID-5170 - Fix more typos mostly in code docs and code comments #5056

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

Merged
merged 3 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ For instructions on upgrading to newer versions, visit

### Resolved Issues

* \#4091 Use sublcass context when calling a scope defined in a superclass. (Edgars Beigarts)
* \#4091 Use subclass context when calling a scope defined in a superclass. (Edgars Beigarts)

* \#4075 Made remove index logging specific to each index that was actually getting removed.

Expand All @@ -107,7 +107,7 @@ For instructions on upgrading to newer versions, visit

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

* \#3991 Fixed emebdded documents not flagging as changed after calling #changed? and modifying the
* \#3991 Fixed embedded documents not flagging as changed after calling #changed? and modifying the
child elements.

* \#3874 Adding snapshot option to context.
Expand Down Expand Up @@ -568,7 +568,7 @@ child elements.
* \#3197 Improvements in the calls to `aggregates` on root and embedded
collections. (Wojciech Piekutowski)

* \#3144/\#3219 Fixing name colission on @_children ivar. (Arthur Neves)
* \#3144/\#3219 Fixing name collision on @_children ivar. (Arthur Neves)

* \#3088 Range field can accept a hash, which could be the attribute from the db.
(Daniel Libanori)
Expand All @@ -589,9 +589,9 @@ child elements.

### Resolved Issues

* \#3465 Fixed ambigous relation errors where inverse_of is set to nil.
* \#3465 Fixed ambiguous relation errors where inverse_of is set to nil.

* \#3414 Backkport skip and limit options on aggregation. (Wojciech Piekutowski)
* \#3414 Backport skip and limit options on aggregation. (Wojciech Piekutowski)

* \#3469 Fix RegexpError: failed to allocate memory: /\./ on .hash_dot_syntax? (Dmitry Krasnoukhov)

Expand Down Expand Up @@ -628,7 +628,7 @@ child elements.

* \#3137 Allow multiple `belongs_to` sets in a row with ids.

* \#3079 Embbed docs with paranoia parents, were losing the _id when
* \#3079 Embedded docs with paranoia parents were losing the _id when
reloading from db, as they didnt have the right persisted? value. (Arthur Neves)

* \#3081 Criteria's `method_missing` now checks if an array responds to the provided
Expand Down Expand Up @@ -1342,7 +1342,7 @@ child elements.
* \#2411 BigDecimal fields are properly stored as strings when mongoizing
integers and floats.

* \#2409 Don't warn about missing mongoid.yml if configured programatically.
* \#2409 Don't warn about missing mongoid.yml if configured programmatically.

* \#2403 Return false on `update_all` of an embeds many with no documents.

Expand Down Expand Up @@ -1390,7 +1390,7 @@ child elements.

* \#2353 Allow `update_attribute` to properly handle aliased fields.

* \#2348 Conversion of strings to times should raise an arugment error if the
* \#2348 Conversion of strings to times should raise an argument error if the
string is invalid. (Campbell Allen)

* \#2346 Ensure `belongs_to` relations are evolvable when passed the proxy and
Expand Down Expand Up @@ -1912,7 +1912,7 @@ child elements.
criteria.merge(filter)

* \#1635 All exceptions now provide more comprehensive errors, including
the problem that occured, a detail summary of why it happened, and
the problem that occurred, a detail summary of why it happened, and
potential resolutions. Example:

(Mongoid::Errors::DocumentNotFound)
Expand All @@ -1929,7 +1929,7 @@ child elements.
false, which will cause a nil to be returned instead
of raising this error.

* \#1616 `Model.find_by` added which takes a hash of arugments to search
* \#1616 `Model.find_by` added which takes a hash of arguments to search
for in the database. If no single document is returned a DocumentNotFound
error is raised. (Piotr Jakubowski)

Expand Down Expand Up @@ -1990,7 +1990,7 @@ child elements.

* \#1291 Mongoid now supports any number of database connections as defined in
the mongoid.yml. For example you could have a local single server db, a
multi availablity zone replica set, and a shard cluster all in the same
multi availability zone replica set, and a shard cluster all in the same
application environment. Mongoid can connect to any session at any point in
time.

Expand Down Expand Up @@ -2941,7 +2941,7 @@ child elements.
* \#1463 Batch insert consumers are now scoped to collection to avoid persistence
of documents to other collections in callbacks going to the wrong place.

* \#1462 Assigning has many relations via nested attribtues `*_attributes=` does
* \#1462 Assigning has many relations via nested attributes `*_attributes=` does
not autosave the relation.

* \#1461 Fixed serialization of foreign key fields in complex criteria not to
Expand Down Expand Up @@ -3040,7 +3040,7 @@ child elements.

* \#1386 Lowered mongo/bson dependency to 1.3

* \#1377 Fix aggregation functions to properly handle nil or indefined values.
* \#1377 Fix aggregation functions to properly handle nil or undefined values.
(Maxime Garcia)

* \#1373 Warn if a scope overrides another scope.
Expand Down Expand Up @@ -3121,7 +3121,7 @@ child elements.

* \#1287 Fixed max versions limitation with versioning.

* \#1277 attribute_will_change! properly flags the attribute even if no change occured.
* \#1277 attribute_will_change! properly flags the attribute even if no change occurred.

* \#1063 Paranoid documents properly run destroy callbacks on soft destroy.

Expand Down Expand Up @@ -3156,7 +3156,7 @@ child elements.

* \#1256 Mongoid now can create indexes for models in Rails engines. (Caio Filipini)

* \#1228 Allow pre formatting of compsoite keys by passing a block to #key.
* \#1228 Allow pre formatting of composite keys by passing a block to #key.
(Ben Hundley)

* \#1222 Scoped mass assignment is now supported. (Andrew Shaydurov)
Expand Down Expand Up @@ -3236,7 +3236,7 @@ child elements.

## 2.2.4

* \#1377 Fix aggregation functions to properly handle nil or indefined values.
* \#1377 Fix aggregation functions to properly handle nil or undefined values.
(Maxime Garcia)

* \#1373 Warn if a scope overrides another scope.
Expand All @@ -3250,7 +3250,7 @@ child elements.
key without error.

* \#1350, \#1351 Fixed errors in the string conversions of double quotes and
tilde when paramterizing keys.
tilde when parameterizing keys.

* \#1349 Mongoid documents should not blow up when including Enumerable.
(Jonas Nicklas)
Expand Down
4 changes: 2 additions & 2 deletions lib/mongoid/association/embedded/cyclic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module ClassMethods
# recursively_embeds_many
# end
#
# @example The previous example is a shorcut for this.
# @example The previous example is a shortcut for this.
#
# class Role
# include Mongoid::Document
Expand Down Expand Up @@ -53,7 +53,7 @@ def recursively_embeds_many(options = {})
# recursively_embeds_one
# end
#
# @example The previous example is a shorcut for this.
# @example The previous example is a shortcut for this.
#
# class Role
# include Mongoid::Document
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/association/nested/one.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def initialize(association, attributes, options)

private

# Is the id in the attribtues acceptable for allowing an update to
# Is the id in the attributes acceptable for allowing an update to
# the existing association?
#
# @api private
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/association/one.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class One < Association::Proxy
# @example Clear the relation.
# relation.clear
#
# @return [ true, false ] If the delete suceeded.
# @return [ true, false ] If the delete succeeded.
def clear
_target.delete
end
Expand Down
4 changes: 2 additions & 2 deletions lib/mongoid/association/referenced/counter_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module CounterCache
extend ActiveSupport::Concern

# Reset the given counter using the .count() query from the
# db. This method is usuful in case that a counter got
# db. This method is useful in case that a counter got
# corrupted, or a new counter was added to the collection.
#
# @example Reset the given counter cache
Expand All @@ -23,7 +23,7 @@ def reset_counters(*counters)
module ClassMethods

# Reset the given counter using the .count() query from the
# db. This method is usuful in case that a counter got
# db. This method is useful in case that a counter got
# corrupted, or a new counter was added to the collection.
#
# @example Reset the given counter cache
Expand Down
4 changes: 2 additions & 2 deletions lib/mongoid/association/referenced/has_many/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ def delete_all(conditions = nil)
# @example Destroy all documents in the association.
# person.posts.destroy_all
#
# @example Conditonally destroy all documents in the association.
# @example Conditionally destroy all documents in the association.
# person.posts.destroy_all({ :title => "Testing" })
#
# @param [ Hash ] conditions Optional conditions to destroy with.
#
# @return [ Integer ] The number of documents destroyd.
# @return [ Integer ] The number of documents destroyed.
def destroy_all(conditions = nil)
remove_all(conditions, :destroy_all)
end
Expand Down
8 changes: 4 additions & 4 deletions lib/mongoid/atomic/modifiers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def add_each_operation(mods, field, value)
end
end

# Get the $addToSet operations or intialize a new one.
# Get the $addToSet operations or initialize a new one.
#
# @example Get the $addToSet operations.
# modifiers.add_to_sets
Expand Down Expand Up @@ -243,7 +243,7 @@ def set_fields
@set_fields ||= {}
end

# Get the $pullAll operations or intialize a new one.
# Get the $pullAll operations or initialize a new one.
#
# @example Get the $pullAll operations.
# modifiers.pull_alls
Expand All @@ -253,7 +253,7 @@ def pull_alls
self["$pullAll"] ||= {}
end

# Get the $pull operations or intialize a new one.
# Get the $pull operations or initialize a new one.
#
# @example Get the $pull operations.
# modifiers.pulls
Expand All @@ -273,7 +273,7 @@ def pushes
self["$push"] ||= {}
end

# Get the $set operations or intialize a new one.
# Get the $set operations or initialize a new one.
#
# @example Get the $set operations.
# modifiers.sets
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/attributes/processing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Processing

# Process the provided attributes casting them to their proper values if a
# field exists for them on the document. This will be limited to only the
# attributes provided in the suppied +Hash+ so that no extra nil values get
# attributes provided in the supplied +Hash+ so that no extra nil values get
# put into the document's attributes.
#
# @example Process the attributes.
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/cacheable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module Cacheable
# If not - will append /id-updated_at.to_s(cache_timestamp_format)
# Without updated_at - will append /id
#
# This is usually called insode a cache() block
# This is usually called inside a cache() block
#
# @example Returns the cache key
# document.cache_key
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/changeable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def previous_changes
end

# Remove a change from the dirty attributes hash. Used by the single field
# atomic updators.
# atomic updaters.
#
# @example Remove a flagged change.
# model.remove_change(:field)
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/contextual/geo_near.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def spherical
self
end

# Tell the command whether or not the retured results should be unique.
# Tell the command whether or not the returned results should be unique.
#
# @example Set the unique flag.
# geo_near.unique(false)
Expand Down
8 changes: 4 additions & 4 deletions lib/mongoid/contextual/memory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,22 +312,22 @@ def limiting=(value)
@limiting = value
end

# Get the skiping value.
# Get the skipping value.
#
# @api private
#
# @example Get the skiping value.
# @example Get the skipping value.
#
# @return [ Integer ] The skip.
def skipping
defined?(@skipping) ? @skipping : nil
end

# Set the skiping value.
# Set the skipping value.
#
# @api private
#
# @example Set the skiping value.
# @example Set the skipping value.
#
# @param [ Integer ] value The skip.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/contextual/none.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def exists?; false; end
#
# @param [ String, Symbol, Array ] args Field or fields to pluck.
#
# @return [ Array ] Emtpy Array
# @return [ Array ] Empty Array
def pluck(*args)
[]
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/criteria/queryable/extensions/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __evolve_time__

# Combine the two objects using an intersection strategy.
#
# @example Interset with the object.
# @example Intersect with the object.
# [ 1, 2 ].__intersect__(3)
#
# @param [ Object ] object The object to intersect with.
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/criteria/queryable/key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module Queryable
#
# Foo.where(:price.gt => 1)
#
# ... causes a Key instance to be created thusly:
# ... causes a Key instance to be created as follows:
#
# Key.new(:price, :__override__, '$gt')
#
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/criteria/queryable/mergeable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def __multi__(criteria, operator)

# Combines criteria into a MongoDB selector.
#
# Criteria is an array of criterions which will be flattened.
# Criteria is an array of criterion objects which will be flattened.
#
# Each criterion can be:
# - A hash
Expand Down
4 changes: 2 additions & 2 deletions lib/mongoid/errors/ambiguous_relationship.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
module Mongoid
module Errors

# This error is raised in case of an ambigous association.
# This error is raised in case of an ambiguous association.
#
# @example An ambigous association.
# @example An ambiguous association.
# class Person
# include Mongoid::Document
#
Expand Down
4 changes: 2 additions & 2 deletions lib/mongoid/errors/document_not_destroyed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
module Mongoid
module Errors

# Raised when attempting to destroy a document that had destory callbacks
# Raised when attempting to destroy a document that had destroy callbacks
# return false.
class DocumentNotDestroyed < MongoidError

# Instnatiate the exception.
# Instantiate the exception.
#
# @example Create the error.
# DocumentNotDestroyed.new(Band)
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/errors/invalid_session_use.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class InvalidSessionUse < MongoidError
# @example Create the error.
# InvalidSessionUse.new(:invalid_session_use)
#
# @param [ :invalid_sesion_use, :invalid_session_nesting ] error_type The type of session misuse.
# @param [ :invalid_session_use, :invalid_session_nesting ] error_type The type of session misuse.
def initialize(error_type)
super(compose_message(error_type.to_s))
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/errors/readonly_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Errors
# database with partial fields.
class ReadonlyDocument < MongoidError

# Instnatiate the exception.
# Instantiate the exception.
#
# @example Create the error.
# ReadonlyDocument.new(Band)
Expand Down
Loading