diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-11-16 17:00:01 +0100 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-11-16 17:00:01 +0100 |
commit | 437ceab139c9aace851b41ce6103d29302750e0c (patch) | |
tree | f04086ac8ee6c3787e8aae031f1b81a2e7ab393a /activerecord/lib | |
parent | 510375b501d1a158edf579966a51568d539dcd6e (diff) | |
download | rails-437ceab139c9aace851b41ce6103d29302750e0c.tar.gz rails-437ceab139c9aace851b41ce6103d29302750e0c.tar.bz2 rails-437ceab139c9aace851b41ce6103d29302750e0c.zip |
Create directory before copying migrations if it does not exist
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index a4c09b654a..2c306d233a 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -387,6 +387,8 @@ module ActiveRecord def copy(destination, sources, options = {}) copied = [] + FileUtils.mkdir_p(destination) unless File.exists?(destination) + destination_migrations = ActiveRecord::Migrator.migrations(destination) last = destination_migrations.last sources.each do |name, path| |