Sha256: 2a4cbcf2905972d2b173979664451830880a08890b2a46b481e4a0a15982d25c

Contents?: true

Size: 732 Bytes

Versions: 11

Compression:

Stored size: 732 Bytes

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"
      end
 
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tkh_authentication-0.1.7 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.1.6 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.1.5 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.1.3 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.1.2 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.1.1 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.1 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.0.12 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.0.11 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.0.10 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_authentication-0.0.9 lib/generators/tkh_authentication/create_or_update_migrations/create_or_update_migrations_generator.rb