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/criteria/options.rb | lib/mongoid/criteria/options.rb | # frozen_string_literal: true
# rubocop:todo all
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)
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/modifiable.rb | lib/mongoid/criteria/modifiable.rb | # frozen_string_literal: true
# rubocop:todo all
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 Additi... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/includable.rb | lib/mongoid/criteria/includable.rb | # frozen_string_literal: true
# rubocop:todo all
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... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/marshalable.rb | lib/mongoid/criteria/marshalable.rb | # frozen_string_literal: true
# rubocop:todo all
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.
# Marsh... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/translator.rb | lib/mongoid/criteria/translator.rb | # frozen_string_literal: true
# rubocop:todo all
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 d... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/findable.rb | lib/mongoid/criteria/findable.rb | # frozen_string_literal: true
# rubocop:todo all
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
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/inspectable.rb | lib/mongoid/criteria/inspectable.rb | # frozen_string_literal: true
# rubocop:todo all
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, matchi... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable.rb | lib/mongoid/criteria/queryable.rb | # frozen_string_literal: true
# rubocop:todo all
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/sma... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/scopable.rb | lib/mongoid/criteria/scopable.rb | # frozen_string_literal: true
# rubocop:todo all
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 Appl... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/selector.rb | lib/mongoid/criteria/queryable/selector.rb | # frozen_string_literal: true
# rubocop:todo all
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 s... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/pipeline.rb | lib/mongoid/criteria/queryable/pipeline.rb | # frozen_string_literal: true
# rubocop:todo all
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... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions.rb | lib/mongoid/criteria/queryable/extensions.rb | # frozen_string_literal: true
# rubocop:todo all
if defined?(ActiveSupport)
unless defined?(ActiveSupport::TimeWithZone)
require "active_support/time_with_zone"
end
require "mongoid/criteria/queryable/extensions/time_with_zone"
end
require "time"
require "mongoid/criteria/queryable/extensions/object"
requir... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/expandable.rb | lib/mongoid/criteria/queryable/expandable.rb | # frozen_string_literal: true
# rubocop:todo all
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... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/smash.rb | lib/mongoid/criteria/queryable/smash.rb | # frozen_string_literal: true
# rubocop:todo all
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 serializ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/options.rb | lib/mongoid/criteria/queryable/options.rb | # frozen_string_literal: true
# rubocop:todo all
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 op... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/optional.rb | lib/mongoid/criteria/queryable/optional.rb | # frozen_string_literal: true
# rubocop:todo all
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 [r... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/key.rb | lib/mongoid/criteria/queryable/key.rb | # frozen_string_literal: true
# rubocop:todo all
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 M... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/aggregable.rb | lib/mongoid/criteria/queryable/aggregable.rb | # frozen_string_literal: true
# rubocop:todo all
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
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/selectable.rb | lib/mongoid/criteria/queryable/selectable.rb | # frozen_string_literal: true
# rubocop:todo all
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 bui... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | true |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/mergeable.rb | lib/mongoid/criteria/queryable/mergeable.rb | # frozen_string_literal: true
# rubocop:todo all
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
# Ins... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/macroable.rb | lib/mongoid/criteria/queryable/macroable.rb | # frozen_string_literal: true
# rubocop:todo all
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... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/storable.rb | lib/mongoid/criteria/queryable/storable.rb | # frozen_string_literal: true
# rubocop:todo all
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 th... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/time_with_zone.rb | lib/mongoid/criteria/queryable/extensions/time_with_zone.rb | # frozen_string_literal: true
# rubocop:todo all
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.
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/big_decimal.rb | lib/mongoid/criteria/queryable/extensions/big_decimal.rb | # frozen_string_literal: true
# rubocop:todo all
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 Mong... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/nil_class.rb | lib/mongoid/criteria/queryable/extensions/nil_class.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to NilClass.
module NilClass
# Add this object to nil.
#
# @example Add the object to a nil value.
#... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/range.rb | lib/mongoid/criteria/queryable/extensions/range.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Range class.
module Range
# Get the range as an array.
#
# @example Get the range as an array.
# ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/array.rb | lib/mongoid/criteria/queryable/extensions/array.rb | # frozen_string_literal: true
# rubocop:todo all
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 ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/set.rb | lib/mongoid/criteria/queryable/extensions/set.rb | # frozen_string_literal: true
# rubocop:todo all
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.
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/time.rb | lib/mongoid/criteria/queryable/extensions/time.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Time class.
module Time
# Evolve the time as a date, UTC midnight.
#
# @example Evolve the time to a date q... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/boolean.rb | lib/mongoid/criteria/queryable/extensions/boolean.rb | # frozen_string_literal: true
# rubocop:todo all
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 MongoD... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/string.rb | lib/mongoid/criteria/queryable/extensions/string.rb | # frozen_string_literal: true
# rubocop:todo all
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 strin... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/object.rb | lib/mongoid/criteria/queryable/extensions/object.rb | # frozen_string_literal: true
# rubocop:todo all
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 t... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/regexp.rb | lib/mongoid/criteria/queryable/extensions/regexp.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Regexp class.
module Regexp
# Is the object a regexp?
#
# @example Is the object a regex?
# /\A... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/date_time.rb | lib/mongoid/criteria/queryable/extensions/date_time.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to DateTime class.
module DateTime
# Evolve the date time into a mongo friendly UTC time.
#
# @example Evolve ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/hash.rb | lib/mongoid/criteria/queryable/extensions/hash.rb | # frozen_string_literal: true
# rubocop:todo all
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... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/date.rb | lib/mongoid/criteria/queryable/extensions/date.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Date class.
module Date
# Evolve the date into a mongo friendly time, UTC midnight.
#
# @example Evolve the... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/symbol.rb | lib/mongoid/criteria/queryable/extensions/symbol.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Symbol class.
module Symbol
# Get the symbol as a specification.
#
# @example Get the symbol as a criteria.... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria/queryable/extensions/numeric.rb | lib/mongoid/criteria/queryable/extensions/numeric.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
class Criteria
module Queryable
module Extensions
# Adds query type-casting behavior to Numeric module and its children.
module Numeric
# Evolve the numeric value into a mongo friendly date, aka UTC time at
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/railties/controller_runtime.rb | lib/mongoid/railties/controller_runtime.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Railties
module ControllerRuntime
# This extension mimics the Rails' internal method to
# measure ActiveRecord runtime during request processing.
# It appends MongoDB runtime value (`mongoid_runtime`) into payload
# o... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/railties/console_sandbox.rb | lib/mongoid/railties/console_sandbox.rb | # rubocop:todo all
require "mongoid/threaded"
require "mongoid/errors/transactions_not_supported"
# This method raises an error if the cluster the client is connected to
# does not support transactions in any case. At the moment this is the case
# of the standalone topology.
#
# Please note that if this method did not... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/railties/bson_object_id_serializer.rb | lib/mongoid/railties/bson_object_id_serializer.rb | # frozen_string_literal: true
module Mongoid
module Railties
module ActiveJobSerializers
# This class provides serialization and deserialization of BSON::ObjectId
# for ActiveJob.
#
# It is important that this class is loaded only when Rails is available
# since it depends on Rails'... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/config/environment.rb | lib/mongoid/config/environment.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Config
# Encapsulates logic for getting environment information.
module Environment
extend self
# Get the name of the environment that Mongoid is running under.
#
# Uses the following sources in order:
# - ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/config/options.rb | lib/mongoid/config/options.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Config
# Encapsulates logic for setting options.
module Options
# Get the defaults or initialize a new empty hash.
#
# @example Get the defaults.
# options.defaults
#
# @return [ Hash ] The default ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/config/encryption.rb | lib/mongoid/config/encryption.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/extensions/boolean'
require 'mongoid/stringified_symbol'
module Mongoid
module Config
# This module contains the logic for configuring Client Side
# Field Level automatic encryption.
#
# @api private
module Encryption
extend... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/config/introspection.rb | lib/mongoid/config/introspection.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Config
# This module provides a way to inspect not only the defined configuration
# settings and their defaults (which are available via
# `Mongoid::Config.settings`), but also the documentation about them. It
# does this by scra... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/config/defaults.rb | lib/mongoid/config/defaults.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Config
# Encapsulates logic for loading defaults.
module Defaults
# Load the defaults for the feature flags in the given Mongoid version.
# Note that this method will load the *new* functionality introduced in
# the gi... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/config/validators.rb | lib/mongoid/config/validators.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/config/validators/async_query_executor"
require "mongoid/config/validators/option"
require "mongoid/config/validators/client"
| ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/config/validators/option.rb | lib/mongoid/config/validators/option.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Config
module Validators
# Validator for configuration options.
module Option
extend self
# Validate a configuration option.
#
# @example Validate a configuration option.
#
# @para... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/config/validators/async_query_executor.rb | lib/mongoid/config/validators/async_query_executor.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Config
module Validators
# Validates the async query executor options in the Mongoid
# configuration. Used during application bootstrapping.
#
# @api private
module AsyncQueryExecutor
extend self
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/config/validators/client.rb | lib/mongoid/config/validators/client.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Config
module Validators
# Validator for client specific configuration.
module Client
extend self
# Standard configuration options.
STANDARD = [ :database, :hosts, :username, :password ].freeze
#... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/clients/options.rb | lib/mongoid/clients/options.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Clients
# Mixin module included into Mongoid::Document which gives
# the ability to manage the database context for persistence
# and query operations. For example, this includes saving
# documents to different collections, and r... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/clients/sessions.rb | lib/mongoid/clients/sessions.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Clients
# Encapsulates behavior for using sessions and transactions.
module Sessions
# Add class method mixin functionality.
#
# @todo Replace with ActiveSupport::Concern
def self.included(base)
base.incl... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/clients/storage_options.rb | lib/mongoid/clients/storage_options.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Clients
# Mixin module included into Mongoid::Document which adds
# the ability to set the collection in which to store the
# document by default.
module StorageOptions
extend ActiveSupport::Concern
included do
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/clients/factory.rb | lib/mongoid/clients/factory.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Clients
# Factory used to create database clients.
module Factory
extend self
extend Loggable
# Create a new client given the named configuration. If no name is
# provided, return a new client with the default co... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/clients/validators.rb | lib/mongoid/clients/validators.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/clients/validators/storage"
| ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/clients/validators/storage.rb | lib/mongoid/clients/validators/storage.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Clients
module Validators
# Validates the options passed to :store_in.
module Storage
extend self
# The valid options for storage.
VALID_OPTIONS = [ :collection, :collection_options, :database, :client ].... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/indexable/specification.rb | lib/mongoid/indexable/specification.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Indexable
# Encapsulates behavior around an index specification.
class Specification
# The mappings of nice Ruby-style names to the corresponding driver
# option name.
MAPPINGS = {
expire_after_seconds: :expire... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/indexable/validators/options.rb | lib/mongoid/indexable/validators/options.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Indexable
module Validators
# Validates the options passed to the index macro.
module Options
extend self
VALID_OPTIONS = [
:background,
:database,
:default_language,
:lang... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/fields/foreign_key.rb | lib/mongoid/fields/foreign_key.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Fields
# Represents a BSON document field definition which stores
# a foreign key that references the ID of another document.
# Used for association behavior.
class ForeignKey < Standard
# Adds the atomic changes for this ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/fields/encrypted.rb | lib/mongoid/fields/encrypted.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Fields
# Represents a field that should be encrypted.
class Encrypted < Standard
def initialize(name, options = {})
@encryption_options = if options[:encrypt].is_a?(Hash)
options[:encrypt]
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/fields/standard.rb | lib/mongoid/fields/standard.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Fields
# Represents a standard field definition (name, type, etc.)
# used to enforce consistent schema structure to the BSON
# documents which Mongoid persists.
class Standard
extend Forwardable
# Defines the behavio... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/fields/localized.rb | lib/mongoid/fields/localized.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Fields
# Represents a BSON document field definition which stores
# different values for different user locale keys in a Ruby
# hashmap (BSON "Object" type). Used for internationalization
# (I18n) support.
class Localized < S... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/fields/validators.rb | lib/mongoid/fields/validators.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/fields/validators/macro"
| ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/fields/validators/macro.rb | lib/mongoid/fields/validators/macro.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Fields
module Validators
# Validates the params passed to the field macro.
module Macro
extend self
OPTIONS = [
:as,
:default,
:identity,
:label,
:localize,
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/maxable.rb | lib/mongoid/persistable/maxable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for setting a field (or fields) to the larger of
# either it's current value, or a given value.
module Maxable
extend ActiveSupport::Concern
# Set the given field or fields to the larger of... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/poppable.rb | lib/mongoid/persistable/poppable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for $pop operations.
module Poppable
extend ActiveSupport::Concern
# Pop or shift items from arrays using the $pop operator.
#
# @example Pop items from an array.
# document... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/destroyable.rb | lib/mongoid/persistable/destroyable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for persistence operations that destroy documents.
module Destroyable
extend ActiveSupport::Concern
# Remove the document from the database with callbacks.
#
# @example Destroy a do... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/logical.rb | lib/mongoid/persistable/logical.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for logical bitwise operations.
module Logical
extend ActiveSupport::Concern
# Performs an atomic $bit operation on the field with the provided hash
# of bitwise ops to execute in order.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/updatable.rb | lib/mongoid/persistable/updatable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for persistence operations that update existing
# documents.
module Updatable
# Update a single attribute and persist the entire document.
# This skips validation but fires the callbacks.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/deletable.rb | lib/mongoid/persistable/deletable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for persistence operations that delete documents.
module Deletable
extend ActiveSupport::Concern
# Remove the document from the database.
#
# @example Remove the document.
# ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/unsettable.rb | lib/mongoid/persistable/unsettable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for $unset operations.
module Unsettable
extend ActiveSupport::Concern
# Perform an $unset operation on the provided fields and in the
# values in the document in memory.
#
# ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/settable.rb | lib/mongoid/persistable/settable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for $set operations.
module Settable
extend ActiveSupport::Concern
# Perform a $set operation on the provided field/value pairs and set the
# values in the document in memory.
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/savable.rb | lib/mongoid/persistable/savable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for persistence operations that save documents.
module Savable
# Save the document - will perform an insert if the document is new, and
# update if not.
#
# @example Save the docume... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/upsertable.rb | lib/mongoid/persistable/upsertable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for persistence operations that upsert documents.
module Upsertable
# Perform an upsert of the document. If the document does not exist in the
# database, then Mongo will insert a new one, othe... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/pullable.rb | lib/mongoid/persistable/pullable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for $pull and $pullAll operations.
module Pullable
extend ActiveSupport::Concern
# Pull single values from the provided arrays.
#
# @example Pull a value from the array.
# d... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/renamable.rb | lib/mongoid/persistable/renamable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for $rename operations.
module Renamable
extend ActiveSupport::Concern
# Rename fields from one value to another via $rename.
#
# @example Rename the fields.
# document.rena... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/incrementable.rb | lib/mongoid/persistable/incrementable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for $inc operations.
module Incrementable
extend ActiveSupport::Concern
# Increment the provided fields by the corresponding values. Values can
# be positive or negative, and if no value ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/creatable.rb | lib/mongoid/persistable/creatable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for persistence operations that create new documents.
module Creatable
extend ActiveSupport::Concern
# Insert a new document into the database. Will return the document
# itself whether o... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/minable.rb | lib/mongoid/persistable/minable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for setting a field (or fields) to the smaller of
# either it's current value, or a given value.
module Minable
extend ActiveSupport::Concern
# Set the given field or fields to the smaller ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/multipliable.rb | lib/mongoid/persistable/multipliable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for $mul operations.
module Multipliable
extend ActiveSupport::Concern
# Multiply the provided fields by the corresponding values. Values can
# be positive or negative, and if no value ex... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable/pushable.rb | lib/mongoid/persistable/pushable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Persistable
# Defines behavior for $push and $addToSet operations.
module Pushable
extend ActiveSupport::Concern
# Add the single values to the arrays only if the value does not already
# exist in the array.
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/timestamps/timeless.rb | lib/mongoid/timestamps/timeless.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Timestamps
# This module adds behavior for turning off timestamping in single or
# multiple calls.
module Timeless
extend ActiveSupport::Concern
# Clears out the timeless option.
#
# @example Clear the timele... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/timestamps/short.rb | lib/mongoid/timestamps/short.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Timestamps
module Short
extend ActiveSupport::Concern
include Created::Short
include Updated::Short
end
end
end
| ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/timestamps/updated.rb | lib/mongoid/timestamps/updated.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/timestamps/updated/short"
module Mongoid
module Timestamps
# This module handles the behavior for setting up document updated at
# timestamp.
module Updated
extend ActiveSupport::Concern
included do
include Mongoid::T... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/timestamps/created.rb | lib/mongoid/timestamps/created.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/timestamps/created/short"
module Mongoid
module Timestamps
# This module handles the behavior for setting up document created at
# timestamp.
module Created
extend ActiveSupport::Concern
included do
include Mongoid::T... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/timestamps/created/short.rb | lib/mongoid/timestamps/created/short.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Timestamps
module Created
# Adds a created_at timestamp to the document, but it is stored as c_at
# with a created_at alias.
module Short
extend ActiveSupport::Concern
included do
include Created
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/timestamps/updated/short.rb | lib/mongoid/timestamps/updated/short.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
module Timestamps
module Updated
# Adds an updated_at timestamp to the document, but it is stored as u_at
# with an updated_at alias.
module Short
extend ActiveSupport::Concern
included do
include Update... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/figaro_spec.rb | spec/figaro_spec.rb | describe Figaro do
describe ".env" do
it "falls through to Figaro::ENV" do
expect(Figaro.env).to eq(Figaro::ENV)
end
end
describe ".adapter" do
let(:adapter) { double(:adapter) }
it "defaults to the generic application adapter" do
expect(Figaro.adapter).to eq(Figaro::Application)
... | ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/rails_spec.rb | spec/rails_spec.rb | describe Figaro::Rails do
before do
run_command_and_stop(<<-CMD)
rails new example \
--api \
--minimal \
--no-rc \
--skip-asset-pipeline \
--skip-bootsnap \
--skip-bundle \
--skip-gemfile \
--skip-git \
--skip-javascript \
--ski... | ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/spec_helper.rb | spec/spec_helper.rb | require "bundler"
Bundler.setup
require "figaro"
Bundler.require(:test)
Dir[File.expand_path("../support/*.rb", __FILE__)].each { |f| require f }
| ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/support/command_helpers.rb | spec/support/command_helpers.rb | module CommandHelpers
def commands
CommandInterceptor.commands
end
end
RSpec.configure do |config|
config.include(CommandHelpers)
config.before(:suite) do
CommandInterceptor.setup
end
config.before do
CommandInterceptor.reset
end
end
| ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/support/aruba.rb | spec/support/aruba.rb | require "aruba/api"
module ArubaHelpers
def insert_into_file_after(file, pattern, addition)
content = cd(".") { IO.read(file) }
content.sub!(pattern, "\\0\n#{addition}")
overwrite_file(file, content)
end
end
RSpec.configure do |config|
config.include(Aruba::Api)
config.include(ArubaHelpers)
con... | ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/support/command_interceptor.rb | spec/support/command_interceptor.rb | require "fileutils"
require "ostruct"
require "yaml"
module CommandInterceptor
class Command < OpenStruct
end
BIN_PATH = File.expand_path("../bin", __FILE__)
LOG_PATH = File.expand_path("../../../tmp/commands.yml", __FILE__)
def self.setup
ENV["PATH"] = "#{BIN_PATH}:#{ENV["PATH"]}"
end
def self.in... | ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/support/reset.rb | spec/support/reset.rb | RSpec.configure do |config|
config.before(:suite) do
$original_env_keys = ::ENV.keys
end
config.before do
Figaro.adapter = nil
Figaro.application = nil
# Restore the original state of ENV for each test
::ENV.keep_if { |k, _| $original_env_keys.include?(k) }
end
end
| ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/figaro/env_spec.rb | spec/figaro/env_spec.rb | describe Figaro::ENV do
subject(:env) { Figaro::ENV }
before do
::ENV["HELLO"] = "world"
::ENV["foo"] = "bar"
end
after do
::ENV["HELLO"] = nil
::ENV["foo"] = nil
end
describe "#method_missing" do
context "plain methods" do
it "makes ENV values accessible as lowercase methods" d... | ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/figaro/application_spec.rb | spec/figaro/application_spec.rb | require "tempfile"
module Figaro
describe Application do
before do
allow_any_instance_of(Application).to receive(:default_path) { "/path/to/app/config/application.yml" }
allow_any_instance_of(Application).to receive(:default_environment) { "development" }
end
describe "#path" do
it "us... | ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/figaro/rails/application_spec.rb | spec/figaro/rails/application_spec.rb | module Figaro
module Rails
describe Application do
describe "#default_path" do
let!(:application) { Application.new }
it "defaults to config/application.yml in Rails.root" do
allow(::Rails).to receive(:root) { Pathname.new("/path/to/app") }
expect {
allow(::... | ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/figaro/cli/install_spec.rb | spec/figaro/cli/install_spec.rb | describe "figaro install" do
before do
create_directory("example")
cd("example")
end
it "creates a configuration file" do
run_command_and_stop("figaro install")
expect("config/application.yml").to be_an_existing_file
end
it "respects path" do
run_command_and_stop("figaro install -p env.... | ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/spec/figaro/cli/heroku_set_spec.rb | spec/figaro/cli/heroku_set_spec.rb | describe "figaro heroku:set" do
before do
create_directory("example")
cd("example")
write_file("config/application.yml", "foo: bar")
end
it "sends Figaro configuration to Heroku" do
run_command_and_stop("figaro heroku:set")
command = commands.last
expect(command.name).to eq("heroku")
... | ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
laserlemon/figaro | https://github.com/laserlemon/figaro/blob/a2d7dcb70c1af1e758089b7d529e0089177c5f51/lib/figaro.rb | lib/figaro.rb | require "figaro/error"
require "figaro/env"
require "figaro/application"
module Figaro
extend self
attr_writer :adapter, :application
def env
Figaro::ENV
end
def adapter
@adapter ||= Figaro::Application
end
def application
@application ||= adapter.new
end
def load
application.loa... | ruby | MIT | a2d7dcb70c1af1e758089b7d529e0089177c5f51 | 2026-01-04T15:48:55.875690Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.