Module: MongoModel

Defined in:
lib/mongomodel/support/instrumented_collection.rb,
lib/mongomodel.rb,
lib/mongomodel/railtie.rb,
lib/mongomodel/version.rb,
lib/mongomodel/document.rb,
lib/mongomodel/support/map.rb,
lib/mongomodel/support/scope.rb,
lib/mongomodel/support/types.rb,
lib/mongomodel/log_subscriber.rb,
lib/mongomodel/document/scopes.rb,
lib/mongomodel/document/indexes.rb,
lib/mongomodel/concerns/logging.rb,
lib/mongomodel/attributes/mongo.rb,
lib/mongomodel/attributes/store.rb,
lib/mongomodel/support/types/set.rb,
lib/mongomodel/support/paginator.rb,
lib/mongomodel/support/reference.rb,
lib/mongomodel/embedded_document.rb,
lib/mongomodel/support/collection.rb,
lib/mongomodel/document/callbacks.rb,
lib/mongomodel/concerns/observing.rb,
lib/mongomodel/concerns/callbacks.rb,
lib/mongomodel/support/exceptions.rb,
lib/mongomodel/support/types/hash.rb,
lib/mongomodel/support/types/date.rb,
lib/mongomodel/support/types/time.rb,
lib/mongomodel/concerns/properties.rb,
lib/mongomodel/concerns/timestamps.rb,
lib/mongomodel/support/types/float.rb,
lib/mongomodel/support/mongo_order.rb,
lib/mongomodel/support/types/array.rb,
lib/mongomodel/concerns/attributes.rb,
lib/mongomodel/concerns/validations.rb,
lib/mongomodel/concerns/activemodel.rb,
lib/mongomodel/support/types/object.rb,
lib/mongomodel/document/validations.rb,
lib/mongomodel/concerns/translation.rb,
lib/mongomodel/support/types/symbol.rb,
lib/mongomodel/document/persistence.rb,
lib/mongomodel/support/types/string.rb,
lib/mongomodel/support/types/custom.rb,
lib/mongomodel/support/mongo_options.rb,
lib/mongomodel/support/configuration.rb,
lib/mongomodel/support/scope/batches.rb,
lib/mongomodel/support/types/integer.rb,
lib/mongomodel/concerns/associations.rb,
lib/mongomodel/support/types/boolean.rb,
lib/mongomodel/support/types/rational.rb,
lib/mongomodel/attributes/typecasting.rb,
lib/mongomodel/concerns/record_status.rb,
lib/mongomodel/concerns/serialization.rb,
lib/mongomodel/support/dynamic_finder.rb,
lib/mongomodel/support/mongo_operator.rb,
lib/mongomodel/concerns/abstract_class.rb,
lib/mongomodel/support/types/date_time.rb,
lib/mongomodel/concerns/pretty_inspect.rb,
lib/mongomodel/document/dynamic_finders.rb,
lib/mongomodel/support/scope/pagination.rb,
lib/mongomodel/concerns/document_parent.rb,
lib/mongomodel/support/types/openstruct.rb,
lib/mongomodel/concerns/attribute_methods.rb,
lib/mongomodel/support/scope/load_methods.rb,
lib/mongomodel/document/optimistic_locking.rb,
lib/mongomodel/support/scope/spawn_methods.rb,
lib/mongomodel/support/scope/query_methods.rb,
lib/mongomodel/support/scope/array_methods.rb,
lib/mongomodel/railties/controller_runtime.rb,
lib/mongomodel/support/scope/finder_methods.rb,
lib/mongomodel/support/scope/dynamic_finders.rb,
lib/mongomodel/document/collection_modifiers.rb,
lib/mongomodel/concerns/validations/associated.rb,
lib/mongomodel/document/validations/uniqueness.rb,
lib/mongomodel/concerns/attribute_methods/read.rb,
lib/mongomodel/concerns/attribute_methods/query.rb,
lib/mongomodel/concerns/attribute_methods/dirty.rb,
lib/mongomodel/concerns/attribute_methods/write.rb,
lib/mongomodel/concerns/associations/base/proxy.rb,
lib/mongomodel/concerns/associations/belongs_to.rb,
lib/mongomodel/concerns/attribute_methods/nested.rb,
lib/mongomodel/concerns/attribute_methods/protected.rb,
lib/mongomodel/concerns/attribute_methods/forbidden.rb,
lib/mongomodel/concerns/associations/base/definition.rb,
lib/mongomodel/concerns/associations/has_many_by_ids.rb,
lib/mongomodel/concerns/associations/base/association.rb,
lib/rails/generators/mongo_model/model/model_generator.rb,
lib/rails/generators/mongo_model/config/config_generator.rb,
lib/mongomodel/concerns/attribute_methods/before_type_cast.rb,
lib/mongomodel/concerns/associations/has_many_by_foreign_key.rb,
lib/mongomodel/concerns/attribute_methods/multi_parameter_assignment.rb

Overview

MongoModel::InstrumentedCursor & MongoModel::InstrumentedCollection are wrappers around Mongo::Cursor & Mongo::Collection respectively to add in support for ActiveSupport notifications.

They are primarily used in MongoModel to implement logging.

Defined Under Namespace

Modules: AbstractClass, ActiveModelCompatibility, Associations, AttributeMethods, Attributes, Callbacks, DocumentExtensions, DocumentParent, Generators, Logging, MapReduce, Observing, PrettyInspect, Properties, Railties, RecordStatus, Serialization, Timestamps, Translation, Types, Validations Classes: AssociationTypeMismatch, Collection, Configuration, Document, DocumentInvalid, DocumentNotFound, DocumentNotSaved, DynamicFinder, EmbeddedDocument, Index, InstrumentedCollection, InstrumentedCursor, LogSubscriber, Map, MongoOperator, MongoOptions, MongoOrder, Observer, Paginator, Railtie, Reference, Scope, TooManyDocuments

Constant Summary

VERSION =
"0.5.4"

Class Method Summary collapse

Class Method Details

.configurationObject



101
102
103
# File 'lib/mongomodel.rb', line 101

def self.configuration
  @_configuration ||= Configuration.defaults
end

.configuration=(config) ⇒ Object



105
106
107
108
# File 'lib/mongomodel.rb', line 105

def self.configuration=(config)
  @_database = nil
  @_configuration = Configuration.new(config)
end

.databaseObject



110
111
112
# File 'lib/mongomodel.rb', line 110

def self.database
  @_database ||= configuration.establish_connection
end