Sha256: 07614344e8acf2e46b5765732d1f5bec1bc35dfc8f733b093872b8e93211ee44

Contents?: true

Size: 938 Bytes

Versions: 1

Compression:

Stored size: 938 Bytes

Contents

require 'mongoid'

Mongoid.configure do |config|
  name = 'database_cleaner_test'
  config.master = Mongo::Connection.new.db(name)
end


#::MongoMapper.connection = Mongo::Connection.new('127.0.0.1')
#::MongoMapper.database = 'database_cleaner_test'

class MongoidWidget
  include Mongoid::Document
  field :id, :type => Integer
  field :name

  class << self
    #mongoid doesn't seem to provide this...
    def create!(*args)
      new(*args).save!
    end
  end
end

class MongoidWidgetUsingDatabaseOne
  include Mongoid::Document
  field :id, :type => Integer
  field :name

  class << self
    #mongoid doesn't seem to provide this...
    def create!(*args)
      new(*args).save!
    end
  end
end

class MongoidWidgetUsingDatabaseTwo
  include Mongoid::Document
  field :id, :type => Integer
  field :name

  class << self
    #mongoid doesn't seem to provide this...
    def create!(*args)
      new(*args).save!
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
database_cleaner-0.6.0.rc.1 examples/lib/mongoid_models.rb