source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/transactions_not_supported.rb | Ruby | mit | 3,920 | master | 406 | # frozen_string_literal: true
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
# Create the error.
d... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/readonly_attribute.rb | Ruby | mit | 3,920 | master | 658 | # frozen_string_literal: true
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 the new error.
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/no_map_reduce_output.rb | Ruby | mit | 3,920 | master | 533 | # frozen_string_literal: true
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.new({ map: "" })
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_config_option.rb | Ruby | mit | 3,920 | master | 649 | # frozen_string_literal: true
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.
# InvalidConfigOption.new(:name, [ :opt... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_expression_operator.rb | Ruby | mit | 3,920 | master | 692 | # frozen_string_literal: true
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 was used.
#
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_collection.rb | Ruby | mit | 3,920 | master | 437 | # frozen_string_literal: true
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 initialize(klass)
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/mixed_client_configuration.rb | Ruby | mit | 3,920 | master | 688 | # frozen_string_literal: true
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.
# MixedClientC... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/attribute_not_loaded.rb | Ruby | mit | 3,920 | master | 1,037 | # frozen_string_literal: true
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.
# Band.only(:nam... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/scope_overwrite.rb | Ruby | mit | 3,920 | master | 534 | # frozen_string_literal: true
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 < MongoidError
def initial... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/no_clients_config.rb | Ruby | mit | 3,920 | master | 398 | # frozen_string_literal: true
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
def initialize
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/no_metadata.rb | Ruby | mit | 3,920 | master | 455 | # frozen_string_literal: true
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 [ Class ] klass The d... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/no_client_hosts.rb | Ruby | mit | 3,920 | master | 622 | # frozen_string_literal: true
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, {}})
#
# @param [ Symb... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_transaction_nesting.rb | Ruby | mit | 3,920 | master | 387 | # frozen_string_literal: true
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
super(compose_m... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_estimated_count_criteria.rb | Ruby | mit | 3,920 | master | 598 | # frozen_string_literal: true
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 the criteria
# ... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_around_callback.rb | Ruby | mit | 3,920 | master | 371 | # 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... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_async_query_executor.rb | Ruby | mit | 3,920 | master | 596 | # frozen_string_literal: true
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 async query executor... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_path.rb | Ruby | mit | 3,920 | master | 466 | # frozen_string_literal: true
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)
#
# @param [ Class ] k... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/no_environment.rb | Ruby | mit | 3,920 | master | 406 | # frozen_string_literal: true
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.new
def initia... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/rollback.rb | Ruby | mit | 3,920 | master | 517 | # frozen_string_literal: true
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 exception is passed o... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_includes.rb | Ruby | mit | 3,920 | master | 797 | # frozen_string_literal: true
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.new(Band, [ :members ]... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/unsupported_isolation_level.rb | Ruby | mit | 3,920 | master | 565 | # 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... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_query.rb | Ruby | mit | 3,920 | master | 954 | # frozen_string_literal: true
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.
#
# @api priv... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/sessions_not_supported.rb | Ruby | mit | 3,920 | master | 390 | # frozen_string_literal: true
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.
def initializ... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_session_nesting.rb | Ruby | mit | 3,920 | master | 371 | # frozen_string_literal: true
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(compose_message('inva... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/unsupported_javascript.rb | Ruby | mit | 3,920 | master | 756 | # frozen_string_literal: true
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.
#
# @example Create the... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/empty_config_file.rb | Ruby | mit | 3,920 | master | 507 | # frozen_string_literal: true
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.
#
# @api ... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/unrecognized_model_alias.rb | Ruby | mit | 3,920 | master | 1,698 | # 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... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_auto_encryption_configuration.rb | Ruby | mit | 3,920 | master | 805 | # frozen_string_literal: true
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 of the client config.
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_relation_option.rb | Ruby | mit | 3,920 | master | 847 | # frozen_string_literal: true
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, invalid_option: 'make_... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/no_client_config.rb | Ruby | mit | 3,920 | master | 524 | # frozen_string_literal: true
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.
# NoClientConfig.new(:a... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/too_many_nested_attribute_records.rb | Ruby | mit | 3,920 | master | 560 | # frozen_string_literal: true
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 TooManyNestedAttributeRecords < MongoidErr... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/readonly_document.rb | Ruby | mit | 3,920 | master | 516 | # frozen_string_literal: true
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.
# ReadonlyDocument... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/unrecognized_resolver.rb | Ruby | mit | 3,920 | master | 757 | # 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... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/mixed_relations.rb | Ruby | mit | 3,920 | master | 781 | # frozen_string_literal: true
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
# include Mongoid::Docu... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/ambiguous_relationship.rb | Ruby | mit | 3,920 | master | 1,387 | # frozen_string_literal: true
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
# has_many :referred_in... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_elem_match_operator.rb | Ruby | mit | 3,920 | master | 862 | # frozen_string_literal: true
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 lte ne nin nor not or... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/immutable_attribute.rb | Ruby | mit | 3,920 | master | 783 | # frozen_string_literal: true
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 result in this error.
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_field_option.rb | Ruby | mit | 3,920 | master | 890 | # frozen_string_literal: true
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.new(Model, :name, :lo... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/inverse_not_found.rb | Ruby | mit | 3,920 | master | 783 | # frozen_string_literal: true
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, Person, :town_id)
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/unknown_model.rb | Ruby | mit | 3,920 | master | 693 | # frozen_string_literal: true
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.
#
# @example Instantiate... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_field_type.rb | Ruby | mit | 3,920 | master | 824 | # frozen_string_literal: true
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 Instantiate the error.
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/validations.rb | Ruby | mit | 3,920 | master | 702 | # frozen_string_literal: true
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)
class Validations <... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/callback.rb | Ruby | mit | 3,920 | master | 635 | # frozen_string_literal: true
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 callbacks error.
# ... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/transaction_error.rb | Ruby | mit | 3,920 | master | 537 | # frozen_string_literal: true
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
# transaction fai... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/criteria_argument_required.rb | Ruby | mit | 3,920 | master | 445 | # frozen_string_literal: true
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)
super(compose_... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_global_executor_concurrency.rb | Ruby | mit | 3,920 | master | 445 | # frozen_string_literal: true
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 initialize
super(
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_estimated_count_scoping.rb | Ruby | mit | 3,920 | master | 605 | # frozen_string_literal: true
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 name of the criteria
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/document_not_found.rb | Ruby | mit | 3,920 | master | 3,581 | # frozen_string_literal: true
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
attr_reader :klas... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_scope.rb | Ruby | mit | 3,920 | master | 553 | # frozen_string_literal: true
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 [ Class ] klass The mo... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/no_parent.rb | Ruby | mit | 3,920 | master | 522 | # frozen_string_literal: true
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.new(klass)
#
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_storage_options.rb | Ruby | mit | 3,920 | master | 658 | # frozen_string_literal: true
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_option: 'name')
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_field.rb | Ruby | mit | 3,920 | master | 1,831 | # frozen_string_literal: true
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.
# InvalidField.new(person, :c... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_relation.rb | Ruby | mit | 3,920 | master | 1,753 | # frozen_string_literal: true
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.
# InvalidRelation.n... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_config_file.rb | Ruby | mit | 3,920 | master | 508 | # frozen_string_literal: true
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.
#
# @api p... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_index.rb | Ruby | mit | 3,920 | master | 655 | # frozen_string_literal: true
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 ] klass The model class.
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_dependent_strategy.rb | Ruby | mit | 3,920 | master | 996 | # frozen_string_literal: true
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.
# InvalidDependentStrategy.ne... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_time.rb | Ruby | mit | 3,920 | master | 543 | # frozen_string_literal: true
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 error.
# Invali... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_persistence_option.rb | Ruby | mit | 3,920 | master | 718 | # frozen_string_literal: true
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.
# InvalidPersistenceOpt... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_set_polymorphic_relation.rb | Ruby | mit | 3,920 | master | 1,158 | # frozen_string_literal: true
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 association.
# class F... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/unknown_attribute.rb | Ruby | mit | 3,920 | master | 671 | # frozen_string_literal: true
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.
#
# @example Instantiate t... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/in_memory_collation_not_supported.rb | Ruby | mit | 3,920 | master | 481 | # frozen_string_literal: true
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 unsupported collation error.
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_discriminator_key_target.rb | Ruby | mit | 3,920 | master | 610 | # frozen_string_literal: true
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 private
class Inv... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/document_not_destroyed.rb | Ruby | mit | 3,920 | master | 581 | # frozen_string_literal: true
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.
# DocumentNotDestroyed.new(B... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_find.rb | Ruby | mit | 3,920 | master | 397 | # frozen_string_literal: true
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
super(compose_message('... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/no_client_database.rb | Ruby | mit | 3,920 | master | 636 | # frozen_string_literal: true
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, {}})
#
# @p... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/create_collection_failure.rb | Ruby | mit | 3,920 | master | 988 | # frozen_string_literal: true
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 that
# Mongoid ... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/unregistered_class.rb | Ruby | mit | 3,920 | master | 1,497 | # 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:
#
# ... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/no_default_client.rb | Ruby | mit | 3,920 | master | 542 | # frozen_string_literal: true
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.
# NoDefaultClient.new([ :analytics ])... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/errors/invalid_dot_dollar_assignment.rb | Ruby | mit | 3,920 | master | 624 | # frozen_string_literal: true
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.
#
# @param [ Class ] kla... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/inspectable.rb | Ruby | mit | 3,920 | master | 658 | # frozen_string_literal: true
module Mongoid
class Criteria
# Mixin module included in Mongoid::Criteria which adds custom
# +#inspect+ method functionality.
module Inspectable
# Get a pretty string representation of the criteria, including the
# selector, options, matching count and document... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/includable.rb | Ruby | mit | 3,920 | master | 4,818 | # frozen_string_literal: true
module Mongoid
class Criteria
# Module providing functionality for parsing (nested) inclusion definitions.
module Includable
# Eager loads all the provided associations. Will load all the documents
# into the identity map whose ids match based on the extra query for ... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/findable.rb | Ruby | mit | 3,920 | master | 5,421 | # frozen_string_literal: true
module Mongoid
class Criteria
# Mixin module included in Mongoid::Criteria which adds the ability
# to find document by id.
module Findable
# Execute the criteria or raise an error if no documents found.
#
# @example Execute or raise
# criteria.exec... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/permission.rb | Ruby | mit | 3,920 | master | 1,677 | # frozen_string_literal: true
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
%i[all
all_in
and
all_of
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable.rb | Ruby | mit | 3,920 | master | 3,470 | # frozen_string_literal: true
require 'mongoid/criteria/queryable/expandable'
require 'mongoid/criteria/queryable/extensions'
require 'mongoid/criteria/queryable/key'
require 'mongoid/criteria/queryable/macroable'
require 'mongoid/criteria/queryable/mergeable'
require 'mongoid/criteria/queryable/smash'
require 'mongoi... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/marshalable.rb | Ruby | mit | 3,920 | master | 1,673 | # frozen_string_literal: true
module Mongoid
class Criteria
# Mixin module for Mongoid::Criteria which adds custom
# Marshal.dump functionality.
module Marshalable
# Provides the data needed to Marshal.dump a criteria.
#
# @example Dump the criteria.
# Marshal.dump(criteria)
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/modifiable.rb | Ruby | mit | 3,920 | master | 8,505 | # frozen_string_literal: true
module Mongoid
class Criteria
# Mixin module for Mongoid::Criteria which adds the ability
# to build or create new documents with attributes initialized
# to the conditions of the criteria.
module Modifiable
# @attribute [r] create_attrs Additional attributes to ad... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/translator.rb | Ruby | mit | 3,920 | master | 1,312 | # frozen_string_literal: true
module Mongoid
class Criteria
# This is a helper module for translating atomic and composite
# Ruby values into corresponding query and option components.
# Originally implemented as patches to core classes, that approach
# has generally fallen into disfavor, as it bleed... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/scopable.rb | Ruby | mit | 3,920 | master | 4,915 | # frozen_string_literal: true
module Mongoid
class Criteria
# Mixin module included in Mongoid::Criteria which adds
# functionality related to default query scopes and named
# scopes.
module Scopable
# Applies the default scope to the criteria.
#
# @example Apply the default scope.
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/options.rb | Ruby | mit | 3,920 | master | 529 | # frozen_string_literal: true
module Mongoid
class Criteria
# Module containing functionality for getting options on a Criteria object.
module Options
private
def persistence_context
klass.persistence_context
end
def set_persistence_context(options)
PersistenceContex... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/optional.rb | Ruby | mit | 3,920 | master | 12,773 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# The optional module includes all behavior that has to do with extra
# options surrounding queries, like skip, limit, sorting, etc.
module Optional
extend Macroable
# @attribute [rw] options The query... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/smash.rb | Ruby | mit | 3,920 | master | 4,408 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# This is a smart hash for use with options and selectors.
class Smash < Hash
# @attribute [r] aliases The aliases.
attr_reader :aliases
# @attribute [r] serializers The serializers.
attr_rea... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/expandable.rb | Ruby | mit | 3,920 | master | 2,328 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# This module encapsulates methods that expand various high level
# query forms to the MongoDB hash condition selector syntax.
#
# @example Example high level form.
# Band.where(:foo.gt => 5)
#
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/storable.rb | Ruby | mit | 3,920 | master | 9,397 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# This module encapsulates methods that write query expressions into
# the Criteria's selector.
#
# The query expressions must have already been expanded as necessary.
# The methods of this module do not pe... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/mergeable.rb | Ruby | mit | 3,920 | master | 15,733 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# Contains behavior for merging existing selection with new selection.
module Mergeable
# @attribute [rw] strategy The name of the current strategy.
attr_accessor :strategy
# Instruct the next mergea... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/selectable.rb | Ruby | mit | 3,920 | master | 33,104 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# An queryable selectable is selectable, in that it has the ability to select
# document from the database. The selectable module brings all functionality
# to the selectable that has to do with building MongoDB select... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/aggregable.rb | Ruby | mit | 3,920 | master | 3,429 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# Provides a DSL around crafting aggregation framework commands.
module Aggregable
extend Macroable
# @attribute [r] pipeline The aggregation pipeline.
attr_reader :pipeline
# @attribute [rw... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/options.rb | Ruby | mit | 3,920 | master | 4,480 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# The options is a hash representation of options passed to MongoDB queries,
# such as skip, limit, and sorting criteria.
class Options < Smash
# Convenience method for getting the field options.
#
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/pipeline.rb | Ruby | mit | 3,920 | master | 3,029 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# Represents an aggregation pipeline.
class Pipeline < Array
# @attribute [r] aliases The field aliases.
attr_reader :aliases
# Deep copy the aggregation pipeline. Will clone all the values in the
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/key.rb | Ruby | mit | 3,920 | master | 5,770 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# Key objects represent specifications for building query expressions
# utilizing MongoDB selectors.
#
# Simple key-value conditions are translated directly into expression
# hashes by Mongoid without utili... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/selector.rb | Ruby | mit | 3,920 | master | 10,667 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# The selector is a special kind of hash that knows how to serialize values
# coming into it as well as being alias and locale aware for key names.
class Selector < Smash
# Merges another selector into this one... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/extensions.rb | Ruby | mit | 3,920 | master | 1,057 | # frozen_string_literal: true
if defined?(ActiveSupport)
require 'active_support/time_with_zone' unless defined?(ActiveSupport::TimeWithZone)
require 'mongoid/criteria/queryable/extensions/time_with_zone'
end
require 'time'
require 'mongoid/criteria/queryable/extensions/object'
require 'mongoid/criteria/queryable... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/macroable.rb | Ruby | mit | 3,920 | master | 778 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# Adds macro behavior for adding symbol methods.
module Macroable
# Adds a method on Symbol for convenience in where queries for the
# provided operators.
#
# @example Add a symbol key.
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/extensions/hash.rb | Ruby | mit | 3,920 | master | 5,259 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Hash class.
module Hash
# Add an object to a hash using the merge strategies.
#
# @example Add an object to a hash.
# ... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/extensions/array.rb | Ruby | mit | 3,920 | master | 4,578 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Array class.
module Array
# Combine the two objects using the add strategy.
#
# @example Add the object to the array.
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/extensions/string.rb | Ruby | mit | 3,920 | master | 4,019 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to String class.
module String
# Evolve the string into a mongodb friendly date.
#
# @example Evolve the string.
# "201... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/extensions/time_with_zone.rb | Ruby | mit | 3,920 | master | 1,664 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to
# ActiveSupport::TimeWithZone class.
module TimeWithZone
# Evolve the time as a date, UTC midnight.
#
# @example Evolve ... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/extensions/boolean.rb | Ruby | mit | 3,920 | master | 915 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Mongoid::Boolean class.
module Boolean
module ClassMethods
# Evolve the value into a boolean value stored in MongoDB. Will return
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/extensions/object.rb | Ruby | mit | 3,920 | master | 5,439 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Object class.
module Object
# Combine the two objects using the add strategy.
#
# @example Add the object to the array.
... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/extensions/set.rb | Ruby | mit | 3,920 | master | 813 | # frozen_string_literal: true
require 'set'
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Set class.
module Set
module ClassMethods
# Evolve the set, casting all its elements.
#
# @exampl... |
github | mongodb/mongoid | https://github.com/mongodb/mongoid | lib/mongoid/criteria/queryable/extensions/big_decimal.rb | Ruby | mit | 3,920 | master | 1,561 | # frozen_string_literal: true
require 'bigdecimal'
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to BigDecimal class.
module BigDecimal
module ClassMethods
# Evolves the big decimal into a MongoDB friendly value.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.