Sha256: b7f41477d9f04a38b4baa97452ef4588eae59079dec2f04f010e99b16b6336c4

Contents?: true

Size: 1.02 KB

Versions: 13

Compression:

Stored size: 1.02 KB

Contents

require 'rails/generators/migration'

module TkhAuthentication
  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 user migration'
        migration_template "create_users.rb", "db/migrate/create_users.rb"
        migration_template "add_other_name_to_users.rb", "db/migrate/add_other_name_to_users.rb"
        migration_template "add_email_validation_to_users.rb", "db/migrate/add_email_validation_to_users.rb"
        migration_template "add_password_creation_token.rb", "db/migrate/add_password_creation_token.rb"
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
tkh_authentication-0.9.17.2 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.17.1 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.17 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.16 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.15 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.14 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.13 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.12 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.11 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.10 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.9 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.8 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.9.7 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb