Class: CMS::Generators::MigrationGenerator

Inherits:
ContentTypes
  • Object
show all
Defined in:
lib/generators/cms/migration_generator.rb

Instance Method Summary collapse

Methods inherited from ContentTypes

next_migration_number

Methods inherited from Base

namespace

Instance Method Details

#create_migration_fileObject



9
10
11
12
13
14
15
16
17
# File 'lib/generators/cms/migration_generator.rb', line 9

def create_migration_file
  @migration_types = CMS::Configuration.scoped_types(options)

  if options[:only].present?
    migration_template 'migration.rb', "db/migrate/create_#{options[:only].underscore.pluralize}"
  else
    migration_template 'migration.rb', 'db/migrate/create_cms'
  end
end