aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorScott Barron <scott@elitists.net>2006-03-26 22:15:19 +0000
committerScott Barron <scott@elitists.net>2006-03-26 22:15:19 +0000
commit89352096293fbbd2077197dba8db18d97b939cba (patch)
tree0b0746afae397aa130f6b4de1dacedc5e94475c4 /railties
parent0c07e08d60ddfe4f6ed3aea66b6c4dc8f88e379a (diff)
downloadrails-89352096293fbbd2077197dba8db18d97b939cba.tar.gz
rails-89352096293fbbd2077197dba8db18d97b939cba.tar.bz2
rails-89352096293fbbd2077197dba8db18d97b939cba.zip
Don't raise when the migration file is missing or it'll stop destroy model in
the middle if there is no matching migration file. Closes #4426 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4057 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails_generator/commands.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb
index 7ed461e58e..8d0ac52b03 100644
--- a/railties/lib/rails_generator/commands.rb
+++ b/railties/lib/rails_generator/commands.rb
@@ -428,7 +428,11 @@ end_message
migration_directory relative_destination
migration_file_name = template_options[:migration_file_name] || file_name
- raise "There is no migration named #{migration_file_name}" unless migration_exists?(migration_file_name)
+ unless migration_exists?(migration_file_name)
+ puts "There is no migration named #{migration_file_name}"
+ return
+ end
+
existing_migrations(migration_file_name).each do |file_path|
file(relative_source, file_path, template_options)