Sha256: 537671f3d464a2db4473f08d3add2902b3311b49568f5c445ba50056d1d7e8cd

Contents?: true

Size: 723 Bytes

Versions: 4

Compression:

Stored size: 723 Bytes

Contents

require 'rails/generators/migration'
 
module TkhAuthentication
  module Generators
    class CreateMigrationGenerator < ::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"
      end
 
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tkh_authentication-0.0.8 lib/generators/tkh_authentication/create_migration/create_migration_generator.rb
tkh_authentication-0.0.7 lib/generators/tkh_authentication/create_migration/create_migration_generator.rb
tkh_authentication-0.0.6 lib/generators/tkh_authentication/create_migration/create_migration_generator.rb
tkh_authentication-0.0.5 lib/generators/tkh_authentication/create_migration/create_migration_generator.rb