Class: Padrino::Generators::Migration

### Home Classes Methods

### In Files

- lib/padrino-gen/generators/migration.rb

### Parent

Thor::Group

### Methods

- ::banner
- ::source_root
- #create_migration

### Included Modules

- Thor::Actions
- Padrino::Generators::Actions
- Padrino::Generators::Components::Actions

### Files

- README.rdoc
- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Generators
- Padrino::Generators::Actions
- Padrino::Generators::Actions::ClassMethods
- Padrino::Generators::App
- Padrino::Generators::AppRootNotFound
- Padrino::Generators::Cli
- Padrino::Generators::Component
- Padrino::Generators::Components
- Padrino::Generators::Components::Actions
- Padrino::Generators::Controller
- Padrino::Generators::Helper
- Padrino::Generators::Mailer
- Padrino::Generators::Migration
- Padrino::Generators::Model
- Padrino::Generators::Plugin
- Padrino::Generators::Project
- Padrino::Generators::Runner
- Padrino::Generators::SqlHelpers
- Padrino::Generators::Task
- ActiveRecord
- ActiveRecord::Schema
- Object

No matching classes.

# Padrino::Generators::Migration

Responsible for generating migration files for the appropriate ORM component.

### Public Class Methods

banner() click to toggle source

    # File lib/padrino-gen/generators/migration.rb, line 10
    def self.banner; "padrino-gen migration [name] [fields]"; end

source_root() click to toggle source

    # File lib/padrino-gen/generators/migration.rb, line 9
    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 27
    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.