Sha256: 90ef78e30bf43167f75430a929773600a885035e01cd5e57914f26b78db8fa38

Contents?: true

Size: 1016 Bytes

Versions: 2

Compression:

Stored size: 1016 Bytes

Contents

require 'pathname'
require 'rubygems'

gem 'activesupport'
gem 'mongodb-mongo', '0.9'
gem 'jnunemaker-validatable', '1.7.0'

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

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

require dir + 'key'
require dir + 'finder_options'
require dir + 'rails_compatibility'
require dir + 'save_with_validation'
require dir + 'serialization'
require dir + 'embedded_document'
require dir + 'document'

module MongoMapper
  class DocumentNotFound < StandardError; end
  class DocumentNotValid < StandardError
    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

2 entries across 2 versions & 1 rubygems

Version Path
jnunemaker-mongomapper-0.1.1 lib/mongomapper.rb
jnunemaker-mongomapper-0.1.2 lib/mongomapper.rb