Sha256: 699fb6b03e7759d3243f9c4bc3a7da59c6958af54883f186c5a43586237d4508

Contents?: true

Size: 697 Bytes

Versions: 41

Compression:

Stored size: 697 Bytes

Contents

require 'rails/generators/migration'

module MagicAddresses
  module Generators
    class UpdateGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)
      desc "add magic_addresses update 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( "update_address_migration.rb", "db/migrate/update_magic_addresses.rb" )
      end

    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

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