Sha256: 9e10586fcf2a61fd2ecd6b47f3780e72b63d1d2620988d254d166b411b7e4978

Contents?: true

Size: 708 Bytes

Versions: 42

Compression:

Stored size: 708 Bytes

Contents

require 'rails/generators/migration'

module MagicAddresses
  module Generators
    class AddEarthdistanceGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)
      desc "add magic_addresses earthdistance migrations"

      def self.next_migration_number(path)
        unless @prev_migration_nr
          @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
        else
          @prev_migration_nr += 1
        end
        @prev_migration_nr.to_s
      end

      def copy_migrations
        migration_template( "earthdistance_migration.rb", "db/migrate/add_earthdistance.rb" )
      end

    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
magic_addresses-0.0.44 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.43 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.42 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.41 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.40 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.39 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.39.rc8 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.39.rc7 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.39.rc6 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.39.rc5 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.39.rc4 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.39.rc3 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.39.rc2 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.39.rc1 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.38 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.38.beta2 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.38.beta1 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.37 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.36 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.35 lib/generators/magic_addresses/add_earthdistance_generator.rb