Methods
- E
- I
- M
- O
- R
- S
Instance Public methods
identical?()
Link
migration_dir()
Link
migration_file_name()
Link
relative_existing_migration()
Link
revoke!()
Link
# File railties/lib/rails/generators/actions/create_migration.rb, line 20 def revoke! say_destination = exists? ? relative_existing_migration : relative_destination say_status :remove, :red, say_destination return unless exists? ::FileUtils.rm_rf(existing_migration) unless pretend? existing_migration end
Instance Protected methods
on_conflict_behavior(&block)
Link
# File railties/lib/rails/generators/actions/create_migration.rb, line 42 def on_conflict_behavior(&block) 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) block.call 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." end end