Class: Cardio::Generators::MigrationGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/migration/migration_generator.rb

Overview

generate structure and card migrations

Instance Method Summary collapse

Methods included from ClassMethods

#banner, #banner_command, #namespace, #source_root

Instance Method Details

#create_migration_fileObject



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

def create_migration_file
  migration_type = options["core"] ? :core_cards : :deck_cards
  mig_paths = Schema.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