Class: CustomizeGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/customize/customize_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/generators/customize/customize_generator.rb', line 5

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

Instance Method Details

#copy_migrationsObject



14
15
16
# File 'lib/generators/customize/customize_generator.rb', line 14

def copy_migrations
	 migration_template "migration.rb", "db/migrate/create_customize.rb"
end