Module: Mongoid
- Defined in:
- lib/mongoid.rb,
lib/mongoid/dirty.rb,
lib/mongoid/field.rb,
lib/mongoid/paths.rb,
lib/mongoid/scope.rb,
lib/mongoid/state.rb,
lib/mongoid/config.rb,
lib/mongoid/cursor.rb,
lib/mongoid/errors.rb,
lib/mongoid/extras.rb,
lib/mongoid/fields.rb,
lib/mongoid/factory.rb,
lib/mongoid/finders.rb,
lib/mongoid/indexes.rb,
lib/mongoid/version.rb,
lib/mongoid/contexts.rb,
lib/mongoid/criteria.rb,
lib/mongoid/document.rb,
lib/mongoid/identity.rb,
lib/mongoid/matchers.rb,
lib/mongoid/callbacks.rb,
lib/mongoid/attributes.rb,
lib/mongoid/collection.rb,
lib/mongoid/components.rb,
lib/mongoid/javascript.rb,
lib/mongoid/observable.rb,
lib/mongoid/timestamps.rb,
lib/mongoid/versioning.rb,
lib/mongoid/collections.rb,
lib/mongoid/deprecation.rb,
lib/mongoid/matchers/gt.rb,
lib/mongoid/matchers/in.rb,
lib/mongoid/matchers/lt.rb,
lib/mongoid/matchers/ne.rb,
lib/mongoid/memoization.rb,
lib/mongoid/named_scope.rb,
lib/mongoid/persistence.rb,
lib/mongoid/associations.rb,
lib/mongoid/contexts/ids.rb,
lib/mongoid/matchers/all.rb,
lib/mongoid/matchers/gte.rb,
lib/mongoid/matchers/lte.rb,
lib/mongoid/matchers/nin.rb,
lib/mongoid/matchers/size.rb,
lib/mongoid/contexts/mongo.rb,
lib/mongoid/contexts/paging.rb,
lib/mongoid/matchers/exists.rb,
lib/mongoid/matchers/default.rb,
lib/mongoid/criterion/complex.rb,
lib/mongoid/associations/proxy.rb,
lib/mongoid/collections/master.rb,
lib/mongoid/collections/slaves.rb,
lib/mongoid/criterion/optional.rb,
lib/mongoid/persistence/insert.rb,
lib/mongoid/persistence/remove.rb,
lib/mongoid/persistence/update.rb,
lib/mongoid/contexts/enumerable.rb,
lib/mongoid/criterion/exclusion.rb,
lib/mongoid/criterion/inclusion.rb,
lib/mongoid/persistence/command.rb,
lib/mongoid/associations/options.rb,
lib/mongoid/associations/meta_data.rb,
lib/mongoid/collections/operations.rb,
lib/mongoid/persistence/remove_all.rb,
lib/mongoid/associations/embeds_one.rb,
lib/mongoid/extensions/hash/scoping.rb,
lib/mongoid/extensions/proc/scoping.rb,
lib/mongoid/associations/embedded_in.rb,
lib/mongoid/associations/embeds_many.rb,
lib/mongoid/extensions/hash/accessors.rb,
lib/mongoid/extensions/array/accessors.rb,
lib/mongoid/collections/cyclic_iterator.rb,
lib/mongoid/extensions/date/conversions.rb,
lib/mongoid/extensions/hash/conversions.rb,
lib/mongoid/extensions/nil/assimilation.rb,
lib/mongoid/extensions/time_conversions.rb,
lib/mongoid/persistence/insert_embedded.rb,
lib/mongoid/persistence/remove_embedded.rb,
lib/mongoid/associations/has_one_related.rb,
lib/mongoid/extensions/array/conversions.rb,
lib/mongoid/extensions/float/conversions.rb,
lib/mongoid/extensions/hash/assimilation.rb,
lib/mongoid/associations/has_many_related.rb,
lib/mongoid/extensions/array/assimilation.rb,
lib/mongoid/extensions/binary/conversions.rb,
lib/mongoid/extensions/object/conversions.rb,
lib/mongoid/extensions/string/conversions.rb,
lib/mongoid/extensions/string/inflections.rb,
lib/mongoid/extensions/symbol/inflections.rb,
lib/mongoid/extensions/array/parentization.rb,
lib/mongoid/extensions/boolean/conversions.rb,
lib/mongoid/extensions/integer/conversions.rb,
lib/mongoid/associations/belongs_to_related.rb,
lib/mongoid/extensions/datetime/conversions.rb,
lib/mongoid/extensions/objectid/conversions.rb,
lib/mongoid/extensions/hash/criteria_helpers.rb,
lib/mongoid/extensions/big_decimal/conversions.rb
Overview
:nodoc:
Defined Under Namespace
Modules: Associations, Attributes, Callbacks, Collections, Components, Contexts, Criterion, Dirty, Document, Errors, Extensions, Extras, Fields, Finders, Indexes, Matchers, Memoization, NamedScope, Observable, Paths, Persistence, State, Timestamps, Versioning Classes: Collection, Config, Criteria, Cursor, Deprecation, Factory, Field, Identity, Javascript, Scope
Constant Summary collapse
- MONGODB_VERSION =
"1.4.0"
- VERSION =
"1.9.4"
Class Method Summary collapse
-
.configure ⇒ Object
(also: config)
Sets the Mongoid configuration options.
-
.deprecate(message) ⇒ Object
Easy convenience method for having an alert generated from the deprecation module.
Class Method Details
.configure ⇒ Object Also known as: config
Sets the Mongoid configuration options. Best used by passing a block.
Example:
Mongoid.configure do |config|
name = "mongoid_test"
host = "localhost"
config.allow_dynamic_fields = false
config.master = Mongo::Connection.new.db(name)
config.slaves = [
Mongo::Connection.new(host, 27018, :slave_ok => true).db(name),
Mongo::Connection.new(host, 27019, :slave_ok => true).db(name)
]
end
Returns:
The Mongoid Config
singleton instance.
91 92 93 94 |
# File 'lib/mongoid.rb', line 91 def configure config = Mongoid::Config.instance block_given? ? yield(config) : config end |
.deprecate(message) ⇒ Object
Easy convenience method for having an alert generated from the deprecation module.
Example:
Mongoid.deprecate("Method no longer used")
102 103 104 |
# File 'lib/mongoid.rb', line 102 def deprecate() Mongoid::Deprecation.instance.alert() end |