Sha256: 8af1a0eee7cfdb8e72844f41e08f36d160c8df837110c7c6f4d5362f5fa7eb86

Contents?: true

Size: 1.67 KB

Versions: 6

Compression:

Stored size: 1.67 KB

Contents

require 'pathname'
require 'rubygems'

gem 'activesupport'
gem 'mongodb-mongo', '0.11.1'
gem 'hashrocket-validatable', '>= 1.7.3'

require 'activesupport'
require 'mongo'
require 'validatable'

dir = Pathname(__FILE__).dirname.expand_path + 'mongomapper'

require dir + 'support'

require dir + 'associations'
require dir + 'associations/base'

require dir + 'associations/proxy'
require dir + 'associations/many_documents_proxy'

require dir + 'associations/belongs_to_proxy'
require dir + 'associations/belongs_to_polymorphic_proxy'
require dir + 'associations/many_proxy'
require dir + 'associations/many_polymorphic_proxy'
require dir + 'associations/many_embedded_proxy'
require dir + 'associations/many_embedded_polymorphic_proxy'

require dir + 'callbacks'
require dir + 'finder_options'
require dir + 'dynamic_finder'
require dir + 'key'
require dir + 'observing'
require dir + 'pagination'
require dir + 'save_with_validation'
require dir + 'serialization'
require dir + 'validations'

require dir + 'rails_compatibility/document'
require dir + 'rails_compatibility/embedded_document'

require dir + 'embedded_document'
require dir + 'document'

module MongoMapper
  DocumentNotFound  = Class.new(StandardError)
  
  DocumentNotValid  = Class.new(StandardError) do
    def initialize(document)
      @document = document
      super("Validation failed: #{@document.errors.full_messages.join(", ")}")
    end
  end
  
  def self.connection
    @@connection ||= XGen::Mongo::Driver::Mongo.new
  end

  def self.connection=(new_connection)
    @@connection = new_connection
  end

  def self.database=(name)
    @@database = MongoMapper.connection.db(name)
  end

  def self.database
    @@database
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hashrocket-mongomapper-0.3.10 lib/mongomapper.rb
hashrocket-mongomapper-0.3.11 lib/mongomapper.rb
hashrocket-mongomapper-0.3.5 lib/mongomapper.rb
hashrocket-mongomapper-0.3.6 lib/mongomapper.rb
hashrocket-mongomapper-0.3.7 lib/mongomapper.rb
hashrocket-mongomapper-0.3.8 lib/mongomapper.rb