Sha256: b07df29278462b01613d9e508fd3e4f8fe4b7b22040ef4bd7cb3d9ae60e89635

Contents?: true

Size: 327 Bytes

Versions: 4

Compression:

Stored size: 327 Bytes

Contents

class MigrationGenerator < Rails::Generators::NamedBase 
  include Rails::Generators::MigrationHelper

  desc "Creates a migration"

  def self.source_root
    @source_root ||= File.expand_path("../templates", __FILE__)
  end
    
  def create_migration
    migration "#{name} name:string age:integer admin:boolean"
  end
end 

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
generator-spec-0.4.4 lib/generators/migration/migration_generator.rb
generator-spec-0.4.3 lib/generators/migration/migration_generator.rb
generator-spec-0.4.2 lib/generators/migration/migration_generator.rb
generator-spec-0.4.1 lib/generators/migration/migration_generator.rb