This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracted adapter and migration code and specs
The various adapters are now available via the dm-xxx-adapter repos below the datamapper account on github. The auto_migrate!/auto_upgrade! functionality is now only available in case dm-migrations gets required. In order to get a datamapper application up and running along with automigrations, do the following: require 'dm-core' #optional require 'dm-migrations' DataMapper.setup(:default, 'mysql://localhost/fu') # model definitions ... DataMapper.auto_migrate! Failing to require dm-migrations will result in undefined method `auto_migrate!' for DataMapper:Module (NoMethodError) From this commit on, dm-core does not provide any adapters apart from the abstract and in_memory adapters. This means that from now on, users will need to depend on any of the datamapper/dm-xxx-adapter gems in order to be able to connect to the database of their choice. If automigration facilities are desired, it's necessary to also depend on and require dm-migrations. Unfortunately, the way dm-core's shared adapter specs are currently written doesn't lend itself nicely to the way we want to use them from the various extracted dm-xxx-adapters. Because we lazily require the desired adapter only when DataMapper.setup is called, we cannot require the shared examples before doing so. This is because the shared adapter spec relies on the adapter class to already be known at the time it gets read in. It relies on that because it checks if the various adapter methods like :create, :update etc are supported by the adapter under test. To workaround this, you can use ADAPTER_SUPPORTS=all bundle exec rake spec to run specs for the various dm-xxx-adapter gems. A proper fix for this issue would be to write the shared adapter specs in such a way, that they evaluate the adapter possibilities only at runtime and not immediately when the file gets read in.
- Loading branch information
Showing
24 changed files
with
161 additions
and
3,456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ tmtags | |
*.rbc | ||
|
||
## PROJECT::GENERAL | ||
*.gem | ||
coverage | ||
rdoc | ||
pkg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.