Sha256: a746e440ea235a04b6c30ce71d6e8d9bf658443ec96b3ec4cfb543d77ddb28cb
Contents?: true
Size: 988 Bytes
Versions: 4
Compression:
Stored size: 988 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
4 entries across 4 versions & 1 rubygems