aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/actions/create_migration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators/actions/create_migration.rb')
-rw-r--r--railties/lib/rails/generators/actions/create_migration.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/actions/create_migration.rb b/railties/lib/rails/generators/actions/create_migration.rb
index cf3b7acfff..cffdef6ec9 100644
--- a/railties/lib/rails/generators/actions/create_migration.rb
+++ b/railties/lib/rails/generators/actions/create_migration.rb
@@ -39,7 +39,7 @@ module Rails
protected
- def on_conflict_behavior(&block)
+ def on_conflict_behavior
options = base.options.merge(config)
if identical?
say_status :identical, :blue, relative_existing_migration
@@ -48,14 +48,15 @@ module Rails
say_status :create, :green
unless pretend?
::FileUtils.rm_rf(existing_migration)
- block.call
+ yield
end
elsif options[:skip]
say_status :skip, :yellow
else
say_status :conflict, :red
raise Error, "Another migration is already named #{migration_file_name}: " +
- "#{existing_migration}. Use --force to replace this migration file."
+ "#{existing_migration}. Use --force to replace this migration " +
+ "or --skip to ignore conflicted file."
end
end