mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
resolves breaking mongomapper feature
This commit is contained in:
parent
56b31498c5
commit
fb8431cb51
5 changed files with 10 additions and 3 deletions
|
@ -7,7 +7,7 @@ strategy = ENV['STRATEGY']
|
||||||
if orm && strategy
|
if orm && strategy
|
||||||
|
|
||||||
begin
|
begin
|
||||||
require "#{File.dirname(__FILE__)}/../../lib/#{orm}"
|
require "#{File.dirname(__FILE__)}/../../lib/#{orm}_models"
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
raise "You don't have the #{orm} ORM installed"
|
raise "You don't have the #{orm} ORM installed"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require 'mongo_mapper'
|
require 'mongomapper'
|
||||||
|
|
||||||
::MongoMapper.connection = Mongo::Connection.new('127.0.0.1')
|
::MongoMapper.connection = Mongo::Connection.new('127.0.0.1')
|
||||||
::MongoMapper.database = 'database_cleaner_test'
|
::MongoMapper.database = 'database_cleaner_test'
|
||||||
|
@ -7,4 +7,11 @@ class Widget
|
||||||
include MongoMapper::Document
|
include MongoMapper::Document
|
||||||
key :id, Integer
|
key :id, Integer
|
||||||
key :name, String
|
key :name, String
|
||||||
|
|
||||||
|
class << self
|
||||||
|
#mongomapper doesn't seem to provide this...
|
||||||
|
def create!(*args)
|
||||||
|
new(*args).save!
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue