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.14 lib/generators/magic_addresses/add_earthdistance_generator.rb
magic_addresses-0.0.13 lib/generators/magic_addresses/add_earthdistance_generator.rb