Sha256: 50c4d3bd4df245e49dc5f4286999031c1f3e3fce026464bd5324f318939b0cff
Contents?: true
Size: 466 Bytes
Versions: 3
Compression:
Stored size: 466 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 Widget include Mongoid::Document field :id, :type => Integer field :name class << self #mongomapper doesn't seem to provide this... def create!(*args) new(*args).save! end end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
bitfluent-database_cleaner-0.5.2 | examples/lib/mongoid_models.rb |
database_cleaner-0.5.2 | examples/lib/mongoid_models.rb |
database_cleaner-0.5.1 | examples/lib/mongoid_models.rb |