Class: Card::Generators::MigrationGenerator

Inherits:
MigrationBase show all
Defined in:
card/lib/generators/card/migration/migration_generator.rb

Instance Method Summary collapse

Methods included from ClassMethods

#banner, #source_root

Instance Method Details

#create_migration_fileObject



14
15
16
17
18
19
20
21
22
# File 'card/lib/generators/card/migration/migration_generator.rb', line 14

def create_migration_file
  migration_type = options["core"] ? :core_cards : :deck_cards
  mig_paths = Cardio.migration_paths(migration_type)
  raise "No migration directory for #{migration_type}" if mig_paths.blank?

  set_local_assigns!
  migration_template @migration_template,
                     File.join(mig_paths.first, "#{file_name}.rb")
end