Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added destroy_model_storage for dm-yaml-adapter

  • Loading branch information...
commit 380f44830472483379baed0c5b739908e439b855 1 parent 0b75f16
@snusnu snusnu authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.