Sha256: 037ba8e2a8d611813a23d43954e52c6d6fd70ae7f34bd9def7b877822a58c5f6
Contents?: true
Size: 499 Bytes
Versions: 33
Compression:
Stored size: 499 Bytes
Contents
module MongoTest class ThingBase def self.collection @connection ||= ::Mongo::Connection.new('127.0.0.1') @db ||= @connection.db('database_cleaner_specs') @mongo ||= @db.collection(name) || @db.create_collection(name) end def self.count @mongo.count end def initialize(attrs={}) @attrs = attrs end def save! self.class.collection.insert(@attrs) end end class Widget < ThingBase end class Gadget < ThingBase end end
Version data entries
33 entries across 28 versions & 5 rubygems