Sha256: 1f29ef72a68a2352fb0610a7a2f59197a487b0eed706613ba1f428c9d1b02b0b

Contents?: true

Size: 1.07 KB

Versions: 66

Compression:

Stored size: 1.07 KB

Contents

require "dm-core"
require "dm-transactions"

#Datamapper 1.0 requires you to require dm-migrations to automigrate
require "dm-migrations"

# only to please activerecord API used in database_cleaner/examples/features/step_definitions
# yes, i know that's lazy ...

require "dm-validations"
require "dm-aggregates"

DataMapper.setup(:default, "sqlite3:#{DB_DIR}/datamapper_default.db")
DataMapper.setup(:one, "sqlite3:#{DB_DIR}/datamapper_one.db")
DataMapper.setup(:two, "sqlite3:#{DB_DIR}/datamapper_two.db")

class DataMapperWidget
  include DataMapper::Resource

  property :id,   Serial
  property :name, String
end

class DataMapperWidgetUsingDatabaseOne
  include DataMapper::Resource

  def self.default_repository_name
    :one
  end

  property :id,   Serial
  property :name, String

end

class DataMapperWidgetUsingDatabaseTwo
  include DataMapper::Resource

  def self.default_repository_name
    :two
  end

  property :id,   Serial
  property :name, String

end

DataMapperWidget.auto_migrate!
DataMapperWidgetUsingDatabaseOne.auto_migrate!
DataMapperWidgetUsingDatabaseTwo.auto_migrate!

Version data entries

66 entries across 55 versions & 8 rubygems

Version Path
database_cleaner-1.6.2 examples/lib/datamapper_models.rb
database_cleaner-1.6.1 examples/lib/datamapper_models.rb
database_cleaner-1.6.0 examples/lib/datamapper_models.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/datamapper_models.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/datamapper_models.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/datamapper_models.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/datamapper_models.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/datamapper_models.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/datamapper_models.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/datamapper_models.rb
database_cleaner-1.5.3 examples/lib/datamapper_models.rb
database_cleaner-1.5.2 examples/lib/datamapper_models.rb
database_cleaner-1.5.1 examples/lib/datamapper_models.rb
database_cleaner-1.5.0 examples/lib/datamapper_models.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/database_cleaner-1.4.1/examples/lib/datamapper_models.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/database_cleaner-1.4.1/examples/lib/datamapper_models.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/database_cleaner-1.4.1/examples/lib/datamapper_models.rb
database_cleaner-1.4.1 examples/lib/datamapper_models.rb
database_cleaner-1.4.0 examples/lib/datamapper_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/datamapper_models.rb