Sha256: 38db89f7e085b3e89f3a8e4acd5b28f53fd445ef975e2ea4c3147ce42fb99bf4

Contents?: true

Size: 916 Bytes

Versions: 11

Compression:

Stored size: 916 Bytes

Contents

require 'mongoid'

Mongoid.configure do |config|
  name = 'database_cleaner_test'
  config.connect_to(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

11 entries across 6 versions & 2 rubygems

Version Path
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/database_cleaner-1.2.0/examples/lib/mongoid_models.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/database_cleaner-1.2.0/examples/lib/mongoid_models.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/database_cleaner-1.2.0/examples/lib/mongoid_models.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/database_cleaner-1.2.0/examples/lib/mongoid_models.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/database_cleaner-1.2.0/examples/lib/mongoid_models.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/database_cleaner-1.2.0/examples/lib/mongoid_models.rb
database_cleaner-1.3.0 examples/lib/mongoid_models.rb
database_cleaner-1.2.0 examples/lib/mongoid_models.rb
database_cleaner-1.1.1 examples/lib/mongoid_models.rb
database_cleaner-1.1.0 examples/lib/mongoid_models.rb
database_cleaner-1.0.1 examples/lib/mongoid_models.rb