diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-07-31 14:43:41 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:10 +0200 |
commit | e063879daf55f100f316ad55f44a0df6d545693d (patch) | |
tree | debee2d726dcf47fa57314f0047b7dd8561bc654 /activerecord/lib | |
parent | c7664d112fadb313146da33f48d1da318f249927 (diff) | |
download | rails-e063879daf55f100f316ad55f44a0df6d545693d.tar.gz rails-e063879daf55f100f316ad55f44a0df6d545693d.tar.bz2 rails-e063879daf55f100f316ad55f44a0df6d545693d.zip |
Fix copying migrations to empty directory
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 293c9f3c08..e708b3fbcf 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -395,7 +395,7 @@ module ActiveRecord source_migrations.each do |migration| next if destination_migrations.any? { |m| m.name == migration.name && m.scope == scope.to_s } - migration.version = next_migration_number(last.version + 1).to_i + migration.version = next_migration_number(last ? last.version + 1 : 0).to_i last = migration new_path = File.join(destination, "#{migration.version}_#{migration.name.underscore}.#{scope}.rb") |