Parent

Padrino::Generators::Migration

Responsible for generating migration files for the appropriate ORM component.

Public Class Methods

source_root() click to toggle source

Define the source template root

# File lib/padrino-gen/generators/migration.rb, line 12
def self.source_root; File.expand_path(File.dirname(__FILE__)); end

Public Instance Methods

create_migration() click to toggle source

Creates the migration file within a Padrino project.

# File lib/padrino-gen/generators/migration.rb, line 32
def create_migration
  self.destination_root = options[:root]
  if in_app_root?
    self.behavior = :revoke if options[:destroy]
    if include_component_module_for(:orm)
      create_migration_file(name, name, columns)
    else
      say "<= You need an ORM adapter for run this generator. Sorry!"
      raise SystemExit
    end
  else
    say "You are not at the root of a Padrino application! (config/boot.rb not found)"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.