repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/mixed_relations.rb | lib/mongoid/errors/mixed_relations.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to reference an embedded document from
# a document in another collection that is not its parent.
#
# @example An illegal reference to an embedded document.
# class Post
# i... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/no_default_client.rb | lib/mongoid/errors/no_default_client.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a default client is not defined.
class NoDefaultClient < MongoidError
# Create the new error with the defined client names.
#
# @example Create the new error.
# NoDefaultClien... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_scope.rb | lib/mongoid/errors/invalid_scope.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when defining a scope of an invalid type.
class InvalidScope < MongoidError
# Create the error.
#
# @example Create the error.
# InvalidScope.new(Band, {})
#
# @param [... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/inverse_not_found.rb | lib/mongoid/errors/inverse_not_found.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when no inverse_of definition can be found when needed.
class InverseNotFound < MongoidError
# Create then new error.
#
# @example Create the new error.
# InverseNotFound.new(Town, :citizens, Pe... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/unsupported_isolation_level.rb | lib/mongoid/errors/unsupported_isolation_level.rb | # frozen_string_literal: true
module Mongoid
module Errors
# Raised when an unsupported isolation level is used in Mongoid
# configuration.
class UnsupportedIsolationLevel < MongoidError
# Create the new error caused by attempting to select an unsupported
# isolation level.
#
# @p... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/criteria_argument_required.rb | lib/mongoid/errors/criteria_argument_required.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a method on Criteria is given a nil argument.
class CriteriaArgumentRequired < MongoidError
# Creates the new exception instance.
#
# @api private
def initialize(query_method)
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/document_not_found.rb | lib/mongoid/errors/document_not_found.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when querying the database for a document by a specific id or by
# set of attributes which does not exist. If multiple ids were passed then
# it will display all of those.
class DocumentNotFound < MongoidError
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_storage_options.rb | lib/mongoid/errors/invalid_storage_options.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when options provided to :store_in are invalid.
class InvalidStorageOptions < MongoidError
# Create the new error.
#
# @example Create the new error.
# InvalidStorageOptions.new(Person, invalid_... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/too_many_nested_attribute_records.rb | lib/mongoid/errors/too_many_nested_attribute_records.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to create set nested documents above the
# specified :limit
#
# @example Create the error.
# TooManyNestedAttributeRecords.new('association', limit)
class TooManyNestedAttribute... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_field_option.rb | lib/mongoid/errors/invalid_field_option.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to create a field that has an invalid
# option.
class InvalidFieldOption < MongoidError
# Create the new error.
#
# @example Create the error.
# InvalidFieldOption.... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_relation.rb | lib/mongoid/errors/invalid_relation.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to create an association that conflicts with
# an already defined method.
class InvalidRelation < MongoidError
# Create the new error.
#
# @example Create the error.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/unsaved_document.rb | lib/mongoid/errors/unsaved_document.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when attempting to call create or create! through a
# references_many when the parent document has not been saved. This
# prevents the child from getting persisted and immediately being orphaned.
class UnsavedDocu... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/mongoid_error.rb | lib/mongoid/errors/mongoid_error.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Default parent Mongoid error for all custom errors. This handles the base
# key for the translations and provides the convenience method for
# translating the messages.
class MongoidError < StandardError
attr_read... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/no_clients_config.rb | lib/mongoid/errors/no_clients_config.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when no clients exists in the database
# configuration.
class NoClientsConfig < MongoidError
# Create the new error.
#
# @example Create the error.
# NoClientsConfig.new
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/in_memory_collation_not_supported.rb | lib/mongoid/errors/in_memory_collation_not_supported.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when attempting to do a query with a
# collation on documents in memory.
class InMemoryCollationNotSupported < MongoidError
# Create the new error.
#
# @example Create the new unsuppor... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/validations.rb | lib/mongoid/errors/validations.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when a persistence method ending in ! fails validation. The message
# will contain the full error messages from the +Document+ in question.
#
# @example Create the error.
# Validations.new(person.errors)
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/sessions_not_supported.rb | lib/mongoid/errors/sessions_not_supported.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a session is attempted to be used with a model whose client cannot use it since
# the mongodb deployment doesn't support sessions.
class SessionsNotSupported < MongoidError
# Create the error... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/immutable_attribute.rb | lib/mongoid/errors/immutable_attribute.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when attempting the change the value of an
# immutable attribute. For example, the _id attribute is immutable,
# and attempting to change it on a document that has already been
# persisted will resul... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/transactions_not_supported.rb | lib/mongoid/errors/transactions_not_supported.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a transaction is attempted to be used with a model whose client cannot use it since
# the mongodb deployment doesn't support transactions.
class TransactionsNotSupported < MongoidError
# Crea... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/unknown_model.rb | lib/mongoid/errors/unknown_model.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to instantiate a model object from the value in
# the '_type' field of a document and the class doesn't exist.
class UnknownModel < MongoidError
# Create the new error.
#
#... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_around_callback.rb | lib/mongoid/errors/invalid_around_callback.rb | # frozen_string_literal: true
module Mongoid
module Errors
# This error is raised when an around callback is
# defined by the user without a yield
class InvalidAroundCallback < MongoidError
# Create the new error.
#
# @api private
def initialize
super(compose_message('inva... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/ambiguous_relationship.rb | lib/mongoid/errors/ambiguous_relationship.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised in case of an ambiguous association.
#
# @example An ambiguous association.
# class Person
# include Mongoid::Document
#
# has_many :invitations, inverse_of: :person
# h... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_path.rb | lib/mongoid/errors/invalid_path.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Used when attempting to get embedded paths with incorrect root path set.
class InvalidPath < MongoidError
# Create the new error.
#
# @example Create the error.
# InvalidPath.new(Address)
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_transaction_nesting.rb | lib/mongoid/errors/invalid_transaction_nesting.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a transaction is attempted to be used with a model whose client already
# has an opened transaction.
class InvalidTransactionNesting < MongoidError
# Create the error.
def initialize
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/no_metadata.rb | lib/mongoid/errors/no_metadata.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Used when trying to persist data when metadata has not been set.
class NoMetadata < MongoidError
# Create the new error.
#
# @example Create the error.
# NoMetadata.new(Address)
#
# @param ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/no_client_hosts.rb | lib/mongoid/errors/no_client_hosts.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a client is configured without hosts.
class NoClientHosts < MongoidError
# Create the new error.
#
# @example Create the new error.
# NoClientHosts.new(:default, {}})
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_elem_match_operator.rb | lib/mongoid/errors/invalid_elem_match_operator.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when invalid field-level operator is passed to the $elemMatch
# embedded matcher.
class InvalidElemMatchOperator < InvalidQuery
# @api private
VALID_OPERATORS = %w(
and all eq exists gt gte in lt ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_session_nesting.rb | lib/mongoid/errors/invalid_session_nesting.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a session is attempted to be used with a model whose client already
# has an opened session.
class InvalidSessionNesting < MongoidError
# Create the error.
def initialize
super(... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_expression_operator.rb | lib/mongoid/errors/invalid_expression_operator.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when invalid expression-level operator is passed to an
# embedded matcher.
class InvalidExpressionOperator < InvalidQuery
# Creates the exception.
#
# @param [ String ] operator The operator that wa... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/scope_overwrite.rb | lib/mongoid/errors/scope_overwrite.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to create a scope with an name already
# taken by another scope or method
#
# @example Create the error.
# ScopeOverwrite.new(Person,'teenies')
class ScopeOverwrite < MongoidErr... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/no_map_reduce_output.rb | lib/mongoid/errors/no_map_reduce_output.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when executing a map/reduce without specifying the output
# location.
class NoMapReduceOutput < MongoidError
# Create the new error.
#
# @example Create the new error.
# NoMapReduceOutput.ne... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/create_collection_failure.rb | lib/mongoid/errors/create_collection_failure.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when an attempt to create a collection failed.
class CreateCollectionFailure < MongoidError
# Instantiate the create collection error.
#
# @param [ String ] collection_name The name of the collection th... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_config_option.rb | lib/mongoid/errors/invalid_config_option.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a bad configuration option is attempted to be
# set.
class InvalidConfigOption < MongoidError
# Create the new error.
#
# @example Create the new error.
# InvalidConfigOpt... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_field.rb | lib/mongoid/errors/invalid_field.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to create a field that conflicts with
# an already defined method.
class InvalidField < MongoidError
# Create the new error.
#
# @example Create the error.
# Invali... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/unrecognized_resolver.rb | lib/mongoid/errors/unrecognized_resolver.rb | # frozen_string_literal: true
module Mongoid
module Errors
# Raised when a model resolver is referenced, but not registered.
#
# class Manager
# include Mongoid::Document
# belongs_to :unit, polymorphic: :org
# end
#
# If `:org` has not previously been registered as a mode... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_time.rb | lib/mongoid/errors/invalid_time.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This exception is raised when a bad value is attempted to be converted to
# a date or time.
class InvalidTime < MongoidError
# Create the new invalid date error.
#
# @example Create the new invalid date er... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/readonly_attribute.rb | lib/mongoid/errors/readonly_attribute.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when attempting the change the value of a readonly
# attribute after the document has been persisted.
class ReadonlyAttribute < MongoidError
# Create the new error.
#
# @example Create... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/no_client_config.rb | lib/mongoid/errors/no_client_config.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when attempting to create a new client that does
# not have a named configuration.
class NoClientConfig < MongoidError
# Create the new error.
#
# @example Create the error.
# ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/delete_restriction.rb | lib/mongoid/errors/delete_restriction.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when attempting to destroy a model which has
# an association with dependency option set to restrict.
class DeleteRestriction < MongoidError
# Create the new callbacks error.
#
# @para... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/transaction_error.rb | lib/mongoid/errors/transaction_error.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a transaction failed because
# of an unexpected error.
class TransactionError < MongoidError
# Creates the exception.
#
# @param [ StandardError ] error Error that caused the
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_find.rb | lib/mongoid/errors/invalid_find.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when invalid arguments are passed to #find.
class InvalidFind < MongoidError
# Create the new invalid find error.
#
# @example Create the error.
# InvalidFind.new
def initialize
su... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/attribute_not_loaded.rb | lib/mongoid/errors/attribute_not_loaded.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when attempting to read or write an attribute which has
# not been loaded. This can occur when using `.only` or `.without`
# query projection methods.
#
# @example Getting a field which has not been loaded.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/unknown_attribute.rb | lib/mongoid/errors/unknown_attribute.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to set a value in Mongoid that is not
# already set with dynamic attributes or the field is not defined.
class UnknownAttribute < MongoidError
# Create the new error.
#
# @... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/empty_config_file.rb | lib/mongoid/errors/empty_config_file.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when an empty configuration file is attempted to be
# loaded.
class EmptyConfigFile < MongoidError
# Create the new error.
#
# @param [ String ] path The path of the config file used.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_estimated_count_scoping.rb | lib/mongoid/errors/invalid_estimated_count_scoping.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to call estimated_count
# on a model with a default scope.
class InvalidEstimatedCountScoping < MongoidError
# Creates the exception.
#
# @param [ String ] class_name The n... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_field_type.rb | lib/mongoid/errors/invalid_field_type.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to define a field using a :type option value
# that is not present in the field type mapping.
class InvalidFieldType < MongoidError
# Create the new error.
#
# @example Ins... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_discriminator_key_target.rb | lib/mongoid/errors/invalid_discriminator_key_target.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Creates the exception raised when trying to set or get the
# discriminator key on a child class.
#
# @param [ String ] class_name The class name.
# @param [ String ] operator The class' superclass.
#
# @api ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/unsupported_javascript.rb | lib/mongoid/errors/unsupported_javascript.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when Javascript criteria selector is passed for embedded document.
class UnsupportedJavascript < MongoidError
# Create the new error caused by using Javascript in embedded document criteria selector.
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/drop_collection_failure.rb | lib/mongoid/errors/drop_collection_failure.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when an attempt to drop a collection failed.
class DropCollectionFailure < MongoidError
# Instantiate the drop collection error.
#
# @param [ String ] collection_name The name of the collection that
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/document_not_destroyed.rb | lib/mongoid/errors/document_not_destroyed.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when attempting to destroy a document that had destroy callbacks
# return false.
class DocumentNotDestroyed < MongoidError
# Instantiate the exception.
#
# @example Create the error.
# Docum... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/time_with_zone.rb | lib/mongoid/extensions/time_with_zone.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to ActiveSupport::TimeWithZone class.
module TimeWithZone
# Mongoizes an ActiveSupport::TimeWithZone into a time.
#
# TimeWithZone always mongoize into TimeWithZone instances
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/raw_value.rb | lib/mongoid/extensions/raw_value.rb | # frozen_string_literal: true
# rubocop:todo all
# Wrapper class used when a value cannot be casted in evolve method.
module Mongoid
# Instantiates a new Mongoid::RawValue object. Used as a syntax shortcut.
#
# @example Create a Mongoid::RawValue object.
# Mongoid::RawValue("Beagle")
#
# @return [ Mongo... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/big_decimal.rb | lib/mongoid/extensions/big_decimal.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to BigDecimal class.
module BigDecimal
# Behavior to be invoked when the module is included.
#
# @param [ Module ] base the class or module doing the including
#
# @api... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/nil_class.rb | lib/mongoid/extensions/nil_class.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to NilClass.
module NilClass
# Try to form a setter from this object.
#
# @example Try to form a setter.
# object.__setter__
#
# @return [ nil ] Always nil.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/range.rb | lib/mongoid/extensions/range.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Range class.
module Range
def self.included(base)
base.extend(ClassMethods)
end
# Get the range as arguments for a find.
#
# @example Get the range as find ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/binary.rb | lib/mongoid/extensions/binary.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to BSON::Binary class.
module Binary
# Turn the object from the ruby type we deal with to a Mongo friendly
# type.
#
# @example Mongoize the object.
# object.mongoi... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/true_class.rb | lib/mongoid/extensions/true_class.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to TrueClass
module TrueClass
# Get the value of the object as a mongo friendly sort value.
#
# @example Get the object as sort criteria.
# object.__sortable__
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/array.rb | lib/mongoid/extensions/array.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Array class.
module Array
# Evolve the array into an array of object ids.
#
# @example Evolve the array to object ids.
# [ id ].__evolve_object_id__
#
# @re... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/set.rb | lib/mongoid/extensions/set.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Set class.
module Set
# Turn the object from the ruby type we deal with to a Mongo friendly
# type.
#
# @example Mongoize the object.
# set.mongoize
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/time.rb | lib/mongoid/extensions/time.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Time class.
module Time
# Mongoizes a Time into a time.
#
# Time always mongoize into Time instances
# (which are themselves).
#
# @return [ Time ] self.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/float.rb | lib/mongoid/extensions/float.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Float class.
module Float
# Converts the float into a time as the number of seconds since the epoch.
#
# @example Convert the float into a time.
# 1335532685.117847.__... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/boolean.rb | lib/mongoid/extensions/boolean.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Adds type-casting behavior to Mongoid::Boolean class.
class Boolean
class << self
# Turn the object from the ruby type we deal with to a Mongo friendly
# type.
#
# @example Mongoize the object.
# Boolean.mongoi... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/object_id.rb | lib/mongoid/extensions/object_id.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to BSON::ObjectId.
module ObjectId
# Evolve the object id.
#
# @example Evolve the object id.
# object_id.__evolve_object_id__
#
# @return [ BSON::ObjectId ] ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/string.rb | lib/mongoid/extensions/string.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to String class.
module String
# @attribute [rw] unconvertable_to_bson If the document is unconvertable.
# @deprecated
attr_accessor :unconvertable_to_bson
Mongoid.deprecat... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/false_class.rb | lib/mongoid/extensions/false_class.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to FalseClass.
module FalseClass
# Get the value of the object as a mongo friendly sort value.
#
# @example Get the object as sort criteria.
# object.__sortable__
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/object.rb | lib/mongoid/extensions/object.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Object class.
module Object
def self.included(base)
base.extend(ClassMethods)
end
# Evolve a plain object into an object id.
#
# @example Evolve the object.... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/integer.rb | lib/mongoid/extensions/integer.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Integer class.
module Integer
# Converts the integer into a time as the number of seconds since the epoch.
#
# @example Convert the integer to a time.
# 1335532685.__m... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/regexp.rb | lib/mongoid/extensions/regexp.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Regexp class.
module Regexp
module ClassMethods
# Turn the object from the ruby type we deal with to a Mongo friendly
# type.
#
# @example Mongoize the ob... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/module.rb | lib/mongoid/extensions/module.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Module class.
module Module
# Redefine the method. Will undef the method if it exists or simply
# just define it.
#
# @example Redefine the method.
# Object.re_d... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/decimal128.rb | lib/mongoid/extensions/decimal128.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to BSON::Decimal128 class.
module Decimal128
# Evolve the decimal128.
#
# @example Evolve the decimal128.
# decimal128.__evolve_decimal128__
#
# @return [ BSO... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/date_time.rb | lib/mongoid/extensions/date_time.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Time class.
module DateTime
# Mongoize the date time into a time.
#
# @example Mongoize the date time.
# date_time.__mongoize_time__
#
# @return [ Time | A... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/hash.rb | lib/mongoid/extensions/hash.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Hash class.
module Hash
# Evolves each value in the hash to an object id if it is convertable.
#
# @example Convert the hash values.
# { field: id }.__evolve_object_id... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/date.rb | lib/mongoid/extensions/date.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Date class.
module Date
# Convert the date into a time.
#
# @example Convert the date to a time.
# Date.new(2018, 11, 1).__mongoize_time__
# # => Thu, 01 Nov 2... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions/symbol.rb | lib/mongoid/extensions/symbol.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Extensions
# Adds type-casting behavior to Symbol class.
module Symbol
# Is the symbol a valid value for a Mongoid id?
#
# @example Is the string an id value?
# :_id.mongoid_id?
#
# @return [ true |... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/threaded/lifecycle.rb | lib/mongoid/threaded/lifecycle.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Threaded
BIND = 'bind'.freeze
ASSIGN = 'assign'.freeze
BUILD = 'build'.freeze
LOAD = 'load'.freeze
CREATE = 'create'.freeze
# This module contains convenience methods for document lifecycle that
# resides on threa... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/atomic/paths.rb | lib/mongoid/atomic/paths.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/atomic/paths/embedded"
require "mongoid/atomic/paths/root"
| ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/atomic/modifiers.rb | lib/mongoid/atomic/modifiers.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Atomic
# This class contains the logic for supporting atomic operations against the
# database.
class Modifiers < Hash
# Add the atomic $addToSet modifiers to the hash.
#
# @example Add the $addToSet modifiers.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/atomic/paths/embedded.rb | lib/mongoid/atomic/paths/embedded.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/atomic/paths/embedded/one"
require "mongoid/atomic/paths/embedded/many"
module Mongoid
module Atomic
module Paths
# Common functionality between the two different embedded paths.
module Embedded
attr_reader :delete_modifier,... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/atomic/paths/root.rb | lib/mongoid/atomic/paths/root.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Atomic
module Paths
# This class encapsulates behavior for locating and updating root
# documents atomically.
class Root
attr_reader :document, :path, :position
# Create the new root path utility.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/atomic/paths/embedded/one.rb | lib/mongoid/atomic/paths/embedded/one.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Atomic
module Paths
module Embedded
# This class encapsulates behavior for locating and updating
# documents that are defined as an embedded 1-1.
class One
include Embedded
# Create the new ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/atomic/paths/embedded/many.rb | lib/mongoid/atomic/paths/embedded/many.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Atomic
module Paths
module Embedded
# This class encapsulates behavior for locating and updating
# documents that are defined as an embedded 1-n.
class Many
include Embedded
# Create the new... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/attributes/dynamic.rb | lib/mongoid/attributes/dynamic.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Attributes
# This module contains the behavior for dynamic attributes.
module Dynamic
extend ActiveSupport::Concern
# Override respond_to? so it responds properly for dynamic attributes.
#
# @example Does this ob... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/attributes/processing.rb | lib/mongoid/attributes/processing.rb | # frozen_string_literal: true
module Mongoid
module Attributes
# This module contains the behavior for processing attributes.
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
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/attributes/embedded.rb | lib/mongoid/attributes/embedded.rb | # frozen_string_literal: true
module Mongoid
module Attributes
# Utility module for working with embedded attributes.
module Embedded
extend self
# Fetch an embedded value or subset of attributes via dot notation.
#
# @example Fetch an embedded value via dot notation.
# Embed... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/attributes/nested.rb | lib/mongoid/attributes/nested.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Attributes
# Defines behavior for the Rails nested attributes feature.
module Nested
extend ActiveSupport::Concern
included do
class_attribute :nested_attributes
self.nested_attributes = {}
end
m... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/attributes/readonly.rb | lib/mongoid/attributes/readonly.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Attributes
# This module defines behavior for readonly attributes.
module Readonly
extend ActiveSupport::Concern
included do
class_attribute :readonly_attributes
self.readonly_attributes = ::Set.new
end... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/attributes/projector.rb | lib/mongoid/attributes/projector.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Attributes
# This module defines projection helpers.
#
# Projection rules are rather non-trivial. See
# https://www.mongodb.com/docs/manual/reference/method/db.collection.find/#find-projection
# for server documentation.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/command.rb | lib/mongoid/contextual/command.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Contextual
# Mixin module included in objects which represent database commands.
module Command
# @attribute [r] collection The collection to query against.
# @attribute [r] criteria The criteria for the context.
attr_... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/memory.rb | lib/mongoid/contextual/memory.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/contextual/aggregable/memory"
require "mongoid/association/eager_loadable"
module Mongoid
module Contextual
# Context object used for performing bulk query and persistence
# operations on documents which have been loaded into application
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/map_reduce.rb | lib/mongoid/contextual/map_reduce.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Contextual
# Represents a mapReduce database command instruction.
class MapReduce
extend Forwardable
include Enumerable
include Command
def_delegators :results, :[]
def_delegators :entries, :==, :empty?
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/aggregable.rb | lib/mongoid/contextual/aggregable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Contextual
module Aggregable
# @api private
EMPTY_RESULT = {
"count" => 0,
"sum" => 0,
"avg" => nil,
"min" => nil,
"max" => nil,
}.freeze
end
end
end
| ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/atomic.rb | lib/mongoid/contextual/atomic.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Contextual
# Mixin module included in Mongoid::Criteria which provides a
# direct method interface to MongoDB's Update Operators ($set,
# $pull, $inc, etc.) These operators can be applied to update
# all documents in the database... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/mongo.rb | lib/mongoid/contextual/mongo.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/atomic_update_preparer'
require 'mongoid/pluckable'
require "mongoid/contextual/mongo/documents_loader"
require "mongoid/contextual/atomic"
require "mongoid/contextual/aggregable/mongo"
require "mongoid/contextual/command"
require "mongoid/contextual/ma... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | true |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/queryable.rb | lib/mongoid/contextual/queryable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Contextual
# Mixin module which adds methods to Mongoid::Criteria that
# indicate the criteria query result will be an empty set.
module Queryable
# @attribute [r] collection The collection to query against.
# @attribute... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/none.rb | lib/mongoid/contextual/none.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/contextual/aggregable/none"
module Mongoid
module Contextual
# Context object used for performing bulk query and persistence
# operations on a null set. The method interface of this class
# is consistent with Mongoid::Contextual::Mongo.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/mongo/documents_loader.rb | lib/mongoid/contextual/mongo/documents_loader.rb | # rubocop:todo all
require "mongoid/association/eager_loadable"
module Mongoid
module Contextual
class Mongo
# Loads documents for the provided criteria.
#
# @api private
class DocumentsLoader
extend Forwardable
include Association::EagerLoadable
def_delegators :@... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/aggregable/memory.rb | lib/mongoid/contextual/aggregable/memory.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Contextual
module Aggregable
# Contains behavior for aggregating values in memory.
module Memory
# Get all the aggregate values for the provided field.
# Provided for interface consistency with Aggregable::Mongo.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/aggregable/mongo.rb | lib/mongoid/contextual/aggregable/mongo.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/contextual/aggregable"
module Mongoid
module Contextual
module Aggregable
# Contains behavior for aggregating values in Mongo.
module Mongo
# Get all the aggregate values for the provided field.
#
# @example G... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual/aggregable/none.rb | lib/mongoid/contextual/aggregable/none.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/contextual/aggregable"
module Mongoid
module Contextual
module Aggregable
# Contains behavior for aggregating values in null context.
module None
# Get all the aggregate values for the provided field in null context.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/permission.rb | lib/mongoid/criteria/permission.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
class Criteria
# Mixin module for Mongoid::Criteria which adds strong
# parameters validation when using ActionController::Parameters
# objects as arguments to condition methods.
module Permission
[:all,
:all_in,
:a... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.