Class: Card::Generators::MigrationGenerator
- Inherits:
-
MigrationBase
- Object
- ActiveRecord::Generators::Base
- MigrationBase
- Card::Generators::MigrationGenerator
- Defined in:
- lib/generators/card/migration/migration_generator.rb
Instance Method Summary collapse
Methods included from ClassMethods
Instance Method Details
#create_migration_file ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/generators/card/migration/migration_generator.rb', line 14 def create_migration_file migration_type = ["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 |