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/matcher/gt.rb | lib/mongoid/matcher/gt.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $gt expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/gt/
#
# @api private
module Gt
# Returns whether a value satisfies a $gt expression.
#
# @param [ true | false ] ex... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/all.rb | lib/mongoid/matcher/all.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $all expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/all/
#
# @api private
module All
# Returns whether a value satisfies an $all expression.
#
# @param [ true | false... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/tasks/encryption.rb | lib/mongoid/tasks/encryption.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Tasks
# This module contains helper methods for data encryption.
module Encryption
extend self
# Create a data encryption key for the given kms provider using the
# auto_encryption_options from the client's configuratio... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/tasks/database.rb | lib/mongoid/tasks/database.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Tasks
# Utility module to manage database collections, indexes, sharding, etc.
# Invoked from Rake tasks.
module Database
extend self
# Create collections for each model given the provided globs and the class is
# ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/validatable/associated.rb | lib/mongoid/validatable/associated.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Validatable
# Validates whether or not an association is valid or not. Will correctly
# handle has one and has many associations.
#
# @example Set up the association validations.
#
# class Person
# include Mongo... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/validatable/macros.rb | lib/mongoid/validatable/macros.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Validatable
# Mixin module included in Mongoid::Document which adds various
# validation macro methods, such as +validates_presence_of+ and
# +validates_uniqueness_of+.
module Macros
extend ActiveSupport::Concern
# V... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/validatable/format.rb | lib/mongoid/validatable/format.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Validatable
# Validates that the specified attributes do or do not match a certain
# regular expression.
#
# @example Set up the format validator.
#
# class Person
# include Mongoid::Document
# field :we... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/validatable/presence.rb | lib/mongoid/validatable/presence.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Validatable
# Validates that the specified attributes are not blank (as defined by
# Object#blank?).
#
# @example Define the presence validator.
#
# class Person
# include Mongoid::Document
# field :titl... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/validatable/length.rb | lib/mongoid/validatable/length.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Validatable
# Validates that the specified attributes do or do not match a certain
# length.
#
# @example Set up the length validator.
#
# class Person
# include Mongoid::Document
# field :website
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/validatable/numericality.rb | lib/mongoid/validatable/numericality.rb | # frozen_string_literal: true
module Mongoid
module Validatable
# A specialization of the ActiveModel numericality validator, which adds
# logic to recognize and accept BSON::Decimal128 as a number.
class NumericalityValidator < ActiveModel::Validations::NumericalityValidator
private
# Ensur... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/validatable/localizable.rb | lib/mongoid/validatable/localizable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Validatable
# Adds localization support to validations.
module Localizable
# Validates each for localized fields.
#
# @example Validate localized fields.
# validator.validate_each(model, :name, "value")
#... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/validatable/queryable.rb | lib/mongoid/validatable/queryable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Validatable
# Mixin module included in Mongoid::Validatable::Uniqueness class
# when ensures that the persistence context is cleared when
# executing uniqueness queries.
#
# @todo Move this into the Mongoid::Validatable::Uniq... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/validatable/uniqueness.rb | lib/mongoid/validatable/uniqueness.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Validatable
# Validates whether or not a field is unique against the documents in the
# database.
#
# @example Define the uniqueness validator.
#
# class Person
# include Mongoid::Document
# field :title... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/macros.rb | lib/mongoid/association/macros.rb | # frozen_string_literal: true
module Mongoid
module Association
# This module contains the core macros for defining associations between
# documents. They can be either embedded or referenced.
module Macros
extend ActiveSupport::Concern
included do
class_attribute :embedded, instance... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded.rb | lib/mongoid/association/embedded.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/embedded/cyclic'
require 'mongoid/association/embedded/eager'
require 'mongoid/association/embedded/embedded_in'
require 'mongoid/association/embedded/embeds_many'
require 'mongoid/association/embedded/embeds_one'
| ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/one.rb | lib/mongoid/association/one.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# This is the superclass for one to one relations and defines the common
# behavior or those proxies.
class One < Association::Proxy
# Clear this relation - same as calling #delete on the document.
#
# ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/builders.rb | lib/mongoid/association/builders.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# This module is responsible for defining the build and create methods used
# in one to one associations.
#
# @example Methods that get created.
#
# class Person
# include Mongoid::Document
# ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/nested.rb | lib/mongoid/association/nested.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/nested/nested_buildable'
require 'mongoid/association/nested/many'
require 'mongoid/association/nested/one'
module Mongoid
module Association
module Nested
# The flags indicating that an association can be destroyed.
DEST... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/constrainable.rb | lib/mongoid/association/constrainable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# Used for converting foreign key values to the correct type based on the
# types of ids that the document stores.
module Constrainable
# Convert the supplied object to the appropriate type to set as the
# fo... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/options.rb | lib/mongoid/association/options.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# Options context used for all association types.
module Options
# Returns the name of the parent to a polymorphic child.
#
# @return [ String | Symbol ] The name.
def as
@options[:as]
e... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/proxy.rb | lib/mongoid/association/proxy.rb | # frozen_string_literal: true
require 'mongoid/association/marshalable'
module Mongoid
module Association
# This class is the superclass for all association proxy objects, and contains
# common behavior for all of them.
class Proxy
extend Forwardable
alias extend_proxy extend
# speci... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/marshalable.rb | lib/mongoid/association/marshalable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# Mixin module for Mongoid::Association::Proxy which adds
# custom Marshal.dump functionality.
module Marshalable
# Provides the data needed to Marshal.dump an association proxy.
#
# @example Dump the p... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/reflections.rb | lib/mongoid/association/reflections.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# The reflections module provides convenience methods that can retrieve
# useful information about associations.
module Reflections
extend ActiveSupport::Concern
# Returns the association metadata for the sup... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/bindable.rb | lib/mongoid/association/bindable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# Superclass for all objects that bind associations together.
module Bindable
include Threaded::Lifecycle
attr_reader :_base, :_target, :_association
# Create the new binding.
#
# @example Init... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/relatable.rb | lib/mongoid/association/relatable.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/constrainable'
require 'mongoid/association/options'
module Mongoid
module Association
# This module provides behaviors shared between Association types.
module Relatable
include Constrainable
include Options
#... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/many.rb | lib/mongoid/association/many.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# This is the superclass for all many to one and many to many association
# proxies.
class Many < Association::Proxy
extend Forwardable
include ::Enumerable
def_delegators :criteria, :avg, :max, :min, :... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced.rb | lib/mongoid/association/referenced.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/referenced/auto_save'
require 'mongoid/association/referenced/counter_cache'
require 'mongoid/association/referenced/syncable'
require 'mongoid/association/referenced/belongs_to'
require 'mongoid/association/referenced/has_many'
require 'mon... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/eager.rb | lib/mongoid/association/eager.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# Base class for eager load preload functions.
class Eager
# Instantiate the eager load class.
#
# @example Create the new belongs to eager load preloader.
# BelongsTo.new(association, parent_docs)
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/eager_loadable.rb | lib/mongoid/association/eager_loadable.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/association/eager"
module Mongoid
module Association
# This module defines the eager loading behavior for criteria.
module EagerLoadable
# Indicates whether the criteria has association
# inclusions which should be eager loaded.... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/accessors.rb | lib/mongoid/association/accessors.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# This module contains all the behavior related to accessing associations
# through the getters and setters, and how to delegate to builders to
# create new ones.
module Accessors
extend ActiveSupport::Concern
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/depending.rb | lib/mongoid/association/depending.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
# This module defines the behavior for setting up cascading deletes and
# nullifies for associations, and how to delegate to the appropriate strategy.
module Depending
extend ActiveSupport::Concern
included d... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/with_polymorphic_criteria.rb | lib/mongoid/association/referenced/with_polymorphic_criteria.rb | # frozen_string_literal: true
module Mongoid
module Association
module Referenced
# Implements the `with_polymorphic_criteria` shared behavior.
#
# @api private
module WithPolymorphicCriteria
# If the receiver represents a polymorphic association, applies
# the polymorphic... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_one.rb | lib/mongoid/association/referenced/has_one.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/referenced/has_one/binding'
require 'mongoid/association/referenced/has_one/buildable'
require 'mongoid/association/referenced/has_one/proxy'
require 'mongoid/association/referenced/has_one/eager'
module Mongoid
module Association
mod... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/counter_cache.rb | lib/mongoid/association/referenced/counter_cache.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
# Mixin module included into Mongoid::Document which adds
# the ability to cache the count of opposite-side documents
# in referenced n-to-many associations.
module CounterCache
e... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_and_belongs_to_many.rb | lib/mongoid/association/referenced/has_and_belongs_to_many.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/referenced/has_and_belongs_to_many/binding'
require 'mongoid/association/referenced/has_and_belongs_to_many/buildable'
require 'mongoid/association/referenced/has_and_belongs_to_many/proxy'
require 'mongoid/association/referenced/has_and_bel... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/auto_save.rb | lib/mongoid/association/referenced/auto_save.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
# Mixin module included into Mongoid::Document which adds
# the ability to automatically save opposite-side documents
# in referenced associations when saving the subject document.
module... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_many.rb | lib/mongoid/association/referenced/has_many.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/referenced/has_many/binding'
require 'mongoid/association/referenced/has_many/buildable'
require 'mongoid/association/referenced/has_many/proxy'
require 'mongoid/association/referenced/has_many/enumerable'
require 'mongoid/association/refere... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/syncable.rb | lib/mongoid/association/referenced/syncable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
# This module handles the behavior for synchronizing foreign keys between
# both sides of a many to many associations.
module Syncable
# Is the document able to be synced on the invers... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/belongs_to.rb | lib/mongoid/association/referenced/belongs_to.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/referenced/belongs_to/binding'
require 'mongoid/association/referenced/belongs_to/buildable'
require 'mongoid/association/referenced/belongs_to/proxy'
require 'mongoid/association/referenced/belongs_to/eager'
module Mongoid
module Associa... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_and_belongs_to_many/buildable.rb | lib/mongoid/association/referenced/has_and_belongs_to_many/buildable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class HasAndBelongsToMany
# The Builder behavior for has_and_belongs_to_many associations.
module Buildable
# This builder either takes a hash and queries for the
# obj... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb | lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb | # frozen_string_literal: true
module Mongoid
module Association
module Referenced
class HasAndBelongsToMany
# Transparent proxy for has_and_belongs_to_many associations.
# An instance of this class is returned when calling
# the association getter method on the subject document.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_and_belongs_to_many/binding.rb | lib/mongoid/association/referenced/has_and_belongs_to_many/binding.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class HasAndBelongsToMany
# Binding class for all has_and_belongs_to_many associations.
class Binding
include Bindable
# Binds a single document with the inverse associ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_and_belongs_to_many/eager.rb | lib/mongoid/association/referenced/has_and_belongs_to_many/eager.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class HasAndBelongsToMany
# Eager class for has_and_belongs_to_many associations.
class Eager < Association::Eager
private
def preload
@docs.each do |d|
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_one/buildable.rb | lib/mongoid/association/referenced/has_one/buildable.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/referenced/with_polymorphic_criteria'
module Mongoid
module Association
module Referenced
class HasOne
# The Builder behavior for has_one associations.
module Buildable
include WithPolymorphicCriteria
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_one/proxy.rb | lib/mongoid/association/referenced/has_one/proxy.rb | # frozen_string_literal: true
module Mongoid
module Association
module Referenced
class HasOne
# Transparent proxy for has_one associations.
# An instance of this class is returned when calling the
# association getter method on the subject document. This class
# inherits fr... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_one/binding.rb | lib/mongoid/association/referenced/has_one/binding.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class HasOne
# Binding class for has_one associations.
class Binding
include Bindable
# Binds the base object to the inverse of the association. This is so we
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_one/eager.rb | lib/mongoid/association/referenced/has_one/eager.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class HasOne
# Eager class for has_one associations.
class Eager < Association::Eager
private
def preload
@docs.each do |d|
set_relation(d, ni... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_many/buildable.rb | lib/mongoid/association/referenced/has_many/buildable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class HasMany
# The Builder behavior for has_many associations.
module Buildable
# This method either takes an _id or an object and queries for the
# inverse side using... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_many/proxy.rb | lib/mongoid/association/referenced/has_many/proxy.rb | # frozen_string_literal: true
module Mongoid
module Association
module Referenced
class HasMany
# Transparent proxy for has_many associations.
# An instance of this class is returned when calling the
# association getter method on the subject document. This class
# inherits ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_many/binding.rb | lib/mongoid/association/referenced/has_many/binding.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class HasMany
# Binding class for has_many associations.
class Binding
include Bindable
# Binds a single document with the inverse association. Used
# specifi... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_many/enumerable.rb | lib/mongoid/association/referenced/has_many/enumerable.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/pluckable'
module Mongoid
module Association
module Referenced
class HasMany
# This class is the wrapper for all referenced associations that have a
# target that can be a criteria or array of _loaded documents. This
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/has_many/eager.rb | lib/mongoid/association/referenced/has_many/eager.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class HasMany
# Eager class for has_many associations.
class Eager < Association::Eager
private
def preload
@docs.each do |d|
set_relation(d,... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/belongs_to/buildable.rb | lib/mongoid/association/referenced/belongs_to/buildable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class BelongsTo
# The Builder behavior for belongs_to associations.
module Buildable
# This method either takes an _id or an object and queries for the
# inverse side u... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/belongs_to/proxy.rb | lib/mongoid/association/referenced/belongs_to/proxy.rb | # frozen_string_literal: true
module Mongoid
module Association
module Referenced
class BelongsTo
# Transparent proxy for belong_to associations.
# An instance of this class is returned when calling the
# association getter method on the subject document.
# This class inheri... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/belongs_to/binding.rb | lib/mongoid/association/referenced/belongs_to/binding.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class BelongsTo
# Binding class for belongs_to associations.
class Binding
include Bindable
# Binds the base object to the inverse of the association. This is so we
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/referenced/belongs_to/eager.rb | lib/mongoid/association/referenced/belongs_to/eager.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Referenced
class BelongsTo
# Eager class for belongs_to associations.
class Eager < Association::Eager
private
def preload
@docs.each do |d|
set_relatio... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/nested/one.rb | lib/mongoid/association/nested/one.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Nested
# Builder class used to perform #accepts_nested_attributes_for
# attribute assignment on one-to-n associations.
class One
include Buildable
attr_accessor :destroy
# Builds... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/nested/nested_buildable.rb | lib/mongoid/association/nested/nested_buildable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Nested
# Mixin module containing common functionality used to
# perform #accepts_nested_attributes_for attribute assignment
# on associations.
module Buildable
attr_accessor :attributes, :e... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/nested/many.rb | lib/mongoid/association/nested/many.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Nested
# Builder class used to perform #accepts_nested_attributes_for
# attribute assignment on many-to-n associations.
class Many
include Buildable
# Builds the association depending on ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embedded_in.rb | lib/mongoid/association/embedded/embedded_in.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/embedded/embedded_in/binding'
require 'mongoid/association/embedded/embedded_in/buildable'
require 'mongoid/association/embedded/embedded_in/proxy'
module Mongoid
module Association
module Embedded
# The EmbeddedIn type associa... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/batchable.rb | lib/mongoid/association/embedded/batchable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Embedded
# Contains behavior for executing operations in batch on embedded
# documents.
module Batchable
include Positional
# Insert new documents as a batch push ($push with $each). This... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/cyclic.rb | lib/mongoid/association/embedded/cyclic.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Embedded
# This module provides convenience macros for using cyclic embedded
# associations.
module Cyclic
extend ActiveSupport::Concern
included do
class_attribute :cyclic
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embeds_many.rb | lib/mongoid/association/embedded/embeds_many.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/embedded/embeds_many/binding'
require 'mongoid/association/embedded/embeds_many/buildable'
require 'mongoid/association/embedded/embeds_many/proxy'
module Mongoid
module Association
module Embedded
# The EmbedsMany type associa... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/eager.rb | lib/mongoid/association/embedded/eager.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Embedded
# Eager class for embedded associations (embedded_in, embeds_many,
# embeds_one).
class Eager < Association::Eager
private
# Embedded associations have no preload phase, since t... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embeds_one.rb | lib/mongoid/association/embedded/embeds_one.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/embedded/embeds_one/binding'
require 'mongoid/association/embedded/embeds_one/buildable'
require 'mongoid/association/embedded/embeds_one/proxy'
module Mongoid
module Association
module Embedded
# The EmbedsOne type association... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embeds_one/buildable.rb | lib/mongoid/association/embedded/embeds_one/buildable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Embedded
class EmbedsOne
# Builder class for embeds_one associations.
module Buildable
include Threaded::Lifecycle
# Builds the document out of the attributes using the provided
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embeds_one/proxy.rb | lib/mongoid/association/embedded/embeds_one/proxy.rb | # frozen_string_literal: true
module Mongoid
module Association
module Embedded
class EmbedsOne
# Transparent proxy for embeds_one associations.
# An instance of this class is returned when calling the
# association getter method on the parent document. This
# class inherits... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embeds_one/binding.rb | lib/mongoid/association/embedded/embeds_one/binding.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Embedded
class EmbedsOne
# Binding class for all embeds_one associations.
class Binding
include Bindable
# Binds the base object to the inverse of the association. This is so we
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embedded_in/buildable.rb | lib/mongoid/association/embedded/embedded_in/buildable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Embedded
class EmbeddedIn
# The Builder behavior for embedded_in associations.
module Buildable
include Threaded::Lifecycle
# This builder doesn't actually build anything, just re... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embedded_in/proxy.rb | lib/mongoid/association/embedded/embedded_in/proxy.rb | # frozen_string_literal: true
module Mongoid
module Association
module Embedded
class EmbeddedIn
# Transparent proxy for embedded_in associations.
# An instance of this class is returned when calling the
# association getter method on the child document. This
# class inherit... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embedded_in/binding.rb | lib/mongoid/association/embedded/embedded_in/binding.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Embedded
class EmbeddedIn
# The Binding object for embedded_in associations.
class Binding
include Bindable
# Binds the base object to the inverse of the association. This is so w... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embeds_many/buildable.rb | lib/mongoid/association/embedded/embeds_many/buildable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Embedded
class EmbedsMany
# Builder class for embeds_many associations.
module Buildable
include Threaded::Lifecycle
# Builds the document out of the attributes using the provided... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embeds_many/proxy.rb | lib/mongoid/association/embedded/embeds_many/proxy.rb | # frozen_string_literal: true
require 'mongoid/association/embedded/batchable'
module Mongoid
module Association
module Embedded
class EmbedsMany
# Transparent proxy for embeds_many associations.
# An instance of this class is returned when calling the
# association getter method o... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association/embedded/embeds_many/binding.rb | lib/mongoid/association/embedded/embeds_many/binding.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Association
module Embedded
class EmbedsMany
# Binding class for all embeds_many associations.
class Binding
include Bindable
# Binds a single document with the inverse association. 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_criteria.rb | lib/mongoid/errors/invalid_estimated_count_criteria.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to call estimated_count
# on a filtered criteria.
class InvalidEstimatedCountCriteria < MongoidError
# Creates the exception.
#
# @param [ String ] class_name The name of t... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_set_polymorphic_relation.rb | lib/mongoid/errors/invalid_set_polymorphic_relation.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when trying to set a polymorphic "references in" association to a
# model with multiple "references many/one" associations pointing to that
# first model.
#
# @example Invalid setting of a polymorphic associat... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/readonly_document.rb | lib/mongoid/errors/readonly_document.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when attempting to persist a document that was loaded from the
# database with partial fields.
class ReadonlyDocument < MongoidError
# Instantiate the exception.
#
# @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/invalid_index.rb | lib/mongoid/errors/invalid_index.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when an invalid index is defined.
class InvalidIndex < MongoidError
# Create the new error.
#
# @example Create the error.
# InvalidIndex.new(Band, name: 1)
#
# @param [ Class ] klas... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_async_query_executor.rb | lib/mongoid/errors/invalid_async_query_executor.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a bad async query executor option is attempted
# to be set.
class InvalidQueryExecutor < MongoidError
# Create the new error.
#
# @param [ Symbol | String ] executor The attempted... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_config_file.rb | lib/mongoid/errors/invalid_config_file.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a bad configuration file is attempted to be
# loaded.
class InvalidConfigFile < 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_persistence_option.rb | lib/mongoid/errors/invalid_persistence_option.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when invalid options are used to create a persistence context.
class InvalidPersistenceOption < MongoidError
# Instantiate the persistence context option 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/callback.rb | lib/mongoid/errors/callback.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when calling #save! or .create! on a model when one
# of the callbacks returns false.
class Callback < MongoidError
# Create the new callbacks error.
#
# @example Create the new callba... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_relation_option.rb | lib/mongoid/errors/invalid_relation_option.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when an option provided for an association is invalid.
class InvalidRelationOption < MongoidError
# Create the new error.
#
# @example Create the new error.
# InvalidRelationOption.new(Person, i... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/unregistered_class.rb | lib/mongoid/errors/unregistered_class.rb | # frozen_string_literal: true
module Mongoid
module Errors
# Raised when Mongoid tries to query the identifier to use for a given
# class in a polymorphic association, but the class has not previously
# been registered by resolver that was used for the query.
#
# Here's an example:
#
# ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/nested_attributes_metadata_not_found.rb | lib/mongoid/errors/nested_attributes_metadata_not_found.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when metadata could not be found when defining
# nested attributes, or the name was incorrect.
class NestedAttributesMetadataNotFound < MongoidError
# Create the new metadata error.
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/no_client_database.rb | lib/mongoid/errors/no_client_database.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a client is configured without a database.
class NoClientDatabase < MongoidError
# Create the new error.
#
# @example Create the new error.
# NoClientDatabase.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_dependent_strategy.rb | lib/mongoid/errors/invalid_dependent_strategy.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when an invalid strategy is defined for an association dependency.
class InvalidDependentStrategy < MongoidError
# Create the new error.
#
# @example Create the new error.
# Invali... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_dot_dollar_assignment.rb | lib/mongoid/errors/invalid_dot_dollar_assignment.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to use the setter for a field that starts
# with a dollar sign ($) or contains a dot/period (.).
class InvalidDotDollarAssignment < 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_field_operator.rb | lib/mongoid/errors/invalid_field_operator.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when invalid field-level operator is passed to an
# embedded matcher.
class InvalidFieldOperator < InvalidQuery
# @api private
VALID_OPERATORS = %w(
all elemMatch eq exists gt gte in lt lte ne nin... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/unrecognized_model_alias.rb | lib/mongoid/errors/unrecognized_model_alias.rb | # frozen_string_literal: true
module Mongoid
module Errors
# Raised when a polymorphic association is queried, but the type of the
# association cannot be resolved. This usually happens when the data in
# the database references a type that no longer exists.
#
# For example, consider the followin... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_options.rb | lib/mongoid/errors/invalid_options.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when invalid options are passed to an association macro.
class InvalidOptions < MongoidError
# Instantiate the options error.
#
# @example Create the error.
# InvalidOptions.new(:name, :polymorp... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_query.rb | lib/mongoid/errors/invalid_query.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when invalid query is passed to an embedded matcher, or an
# invalid query fragment is passed to the query builder (Criteria object).
class InvalidQuery < MongoidError
# Create the new invalid query error.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_global_executor_concurrency.rb | lib/mongoid/errors/invalid_global_executor_concurrency.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a bad global executor concurrency option is attempted
# to be set.
class InvalidGlobalExecutorConcurrency < MongoidError
# Create the new error.
#
# @api private
def initial... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/rollback.rb | lib/mongoid/errors/rollback.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error should be raised to deliberately rollback a transaction without
# passing on an exception.
# Normally, raising an exception inside a Mongoid transaction causes rolling
# the MongoDB transaction back, and the e... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/no_environment.rb | lib/mongoid/errors/no_environment.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# Raised when trying to load configuration with no RACK_ENV set
class NoEnvironment < MongoidError
# Create the new no environment error.
#
# @example Create the new no environment error.
# NoEnvironment... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/no_parent.rb | lib/mongoid/errors/no_parent.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to persist an embedded document
# when there is no parent set.
class NoParent < MongoidError
# Create the new error.
#
# @example Create the new error.
# NoParent.n... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_includes.rb | lib/mongoid/errors/invalid_includes.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when an invalid value is passed to an eager
# loading query.
class InvalidIncludes < MongoidError
# Initialize the error.
#
# @example Initialize the error.
# InvalidIncludes.n... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_auto_encryption_configuration.rb | lib/mongoid/errors/invalid_auto_encryption_configuration.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when automatic encryption configuration for a client
# is invalid.
class InvalidAutoEncryptionConfiguration < MongoidError
# Initialize the error.
#
# @param [ Symbol ] name The name o... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/invalid_collection.rb | lib/mongoid/errors/invalid_collection.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when trying to access a Mongo::Collection from an
# embedded document.
#
# @example Create the error.
# InvalidCollection.new(Address)
class InvalidCollection < MongoidError
def initi... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors/mixed_client_configuration.rb | lib/mongoid/errors/mixed_client_configuration.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Errors
# This error is raised when a client configuration contains both a uri and
# other standard options.
class MixedClientConfiguration < MongoidError
# Initialize the error.
#
# @example Initialize the error.
... | 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.