Sha256: ddd9a33ca1a60d7d070717fc1f00cde80e23241568b9dfe01c681f7484a1cf58

Contents?: true

Size: 780 Bytes

Versions: 4

Compression:

Stored size: 780 Bytes

Contents

require 'rails/generators/migration'

module DeliveryUncle
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)
      desc "add the 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 "create_table_email_requests.rb", "db/migrate/create_table_email_requests.rb"
        migration_template "create_table_activities.rb", "db/migrate/create_table_activities.rb"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
delivery_uncle-0.1.5 lib/generators/delivery_uncle/install/install_generator.rb
delivery_uncle-0.1.4 lib/generators/delivery_uncle/install/install_generator.rb
delivery_uncle-0.1.3 lib/generators/delivery_uncle/install/install_generator.rb
delivery_uncle-0.1.2 lib/generators/delivery_uncle/install/install_generator.rb