method
on_conflict_behavior
v5.2.3 -
Show latest stable
-
0 notes -
Class: CreateMigration
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
on_conflict_behavior()
private
Hide source
# File railties/lib/rails/generators/actions/create_migration.rb, line 44 def on_conflict_behavior # :doc: options = base.options.merge(config) if identical? say_status :identical, :blue, relative_existing_migration elsif options[:force] say_status :remove, :green, relative_existing_migration say_status :create, :green unless pretend? ::FileUtils.rm_rf(existing_migration) 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 " "or --skip to ignore conflicted file." end end