Sha256: e2082fc135db66472fc43d9ef5695bda6c3b3b57e2222fa4a320725135c351b9

Contents?: true

Size: 959 Bytes

Versions: 9

Compression:

Stored size: 959 Bytes

Contents

require 'rails/generaTors/migration'

module TkhMailingList
  module Generators
    class CreateOrUpdateMigrationsGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)
      desc "add the migrations and locale files"
      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
        puts 'creating teacher and profile migrations'
        migration_template "add_teacher_status_to_users.rb", "db/migrate/add_teacher_status_to_users.rb"
        migration_template "add_profile_fields_to_users.rb", "db/migrate/add_profile_fields_to_users.rb"
        migration_template "create_contacts.rb", "db/migrate/create_contacts.rb"
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tkh_mailing_list-0.12 lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_mailing_list-0.11.3 lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_mailing_list-0.11.2 lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_mailing_list-0.11.1.1 lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_mailing_list-0.11.1 lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_mailing_list-0.11 lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_mailing_list-0.10.10 lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_mailing_list-0.10.9.1 lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_mailing_list-0.10.9 lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb