From 89352096293fbbd2077197dba8db18d97b939cba Mon Sep 17 00:00:00 2001 From: Scott Barron Date: Sun, 26 Mar 2006 22:15:19 +0000 Subject: 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 --- railties/lib/rails_generator/commands.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails_generator') 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) -- cgit v1.2.3