mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
29 lines
No EOL
579 B
Ruby
29 lines
No EOL
579 B
Ruby
require "dm-core"
|
|
|
|
# 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"
|
|
|
|
db_dir = "#{File.dirname(__FILE__)}/../db"
|
|
|
|
DataMapper.setup(:default, "sqlite3:#{db_dir}/datamapper_one.db")
|
|
|
|
class MapperWidget
|
|
include DataMapper::Resource
|
|
property :id, Serial
|
|
property :name, String
|
|
end
|
|
|
|
|
|
unless defined? Widget
|
|
class Widget < MapperWidget
|
|
end
|
|
|
|
Widget.auto_migrate!
|
|
else
|
|
class AnotherWidget < MapperWidget
|
|
end
|
|
|
|
AnotherWidget.auto_migrate!
|
|
end |