Sha256: 426f3d1e439001dd9eb29cc1526061bfbf8020be3e2f3205257128d5a03f982d

Contents?: true

Size: 508 Bytes

Versions: 10

Compression:

Stored size: 508 Bytes

Contents

class AddressableRecordMigrationGenerator < Rails::Generator::NamedBase
  def initialize( runtime_args, runtime_options={} )
    super
    @stamp = DateTime.now.utc.strftime( "%Y%m%d%H%M%S" )
    parse_args( args )
  end

  def manifest
    record do |m|
      m.directory "db/migrate"
      m.template  "migration.rb", "db/migrate/#{@stamp}_#{name}.rb", :assigns => { :table => @table, :field => @field }
    end
  end

  private

  def parse_args( args )
    @table = args[0]
    @field = args[1]
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
addressable_record-1.5.0 rails_generators/addressable_record_migration_generator/addressable_record_migration_generator.rb
addressable_record-1.4.0 rails_generators/addressable_record_migration_generator/addressable_record_migration_generator.rb
addressable_record-1.3.0 rails_generators/addressable_record_migration_generator/addressable_record_migration_generator.rb
addressable_record-1.2.0 rails_generators/addressable_record_migration_generator/addressable_record_migration_generator.rb
addressable_record-1.1.0 rails_generators/addressable_record_migration_generator/addressable_record_migration_generator.rb
addressable_record-1.0.4 rails_generators/addressable_record_migration_generator/addressable_record_migration_generator.rb
addressable_record-1.0.3 rails_generators/addressable_record_migration_generator/addressable_record_migration_generator.rb
addressable_record-1.0.2 rails_generators/addressable_record_migration_generator/addressable_record_migration_generator.rb
addressable_record-1.0.1 rails_generators/addressable_record_migration_generator/addressable_record_migration_generator.rb
addressable_record-1.0.0 rails_generators/addressable_record_migration_generator/addressable_record_migration_generator.rb