Browse files

Added destroy_model_storage for dm-yaml-adapter

  • Loading branch information...
1 parent 0b75f16 commit 380f44830472483379baed0c5b739908e439b855 @snusnu snusnu committed Apr 30, 2010
Showing with 23 additions and 0 deletions.
  1. +23 −0 lib/dm-migrations/adapters/dm-yaml-adapter.rb
View
23 lib/dm-migrations/adapters/dm-yaml-adapter.rb
@@ -0,0 +1,23 @@
+require 'dm-migrations/auto_migration'
+require 'dm-migrations/adapters/dm-do-adapter'
+
+module DataMapper
+ module Migrations
+ module YamlAdapter
+
+ def self.included(base)
+ DataMapper.extend(Migrations::SingletonMethods)
+ [ :Repository, :Model ].each do |name|
+ DataMapper.const_get(name).send(:include, Migrations.const_get(name))
+ end
+ end
+
+ # @api semipublic
+ def destroy_model_storage(model)
+ yaml_file(model).unlink if yaml_file(model).file?
+ true
+ end
+
+ end
+ end
+end

0 comments on commit 380f448

Please sign in to comment.