Class: Ecm::CmsCore::Generators::MigrationsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/ecm/cms_core/migrations/migrations_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/generators/ecm/cms_core/migrations/migrations_generator.rb', line 11

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



20
21
22
23
# File 'lib/generators/ecm/cms_core/migrations/migrations_generator.rb', line 20

def copy_migrations
  migration_template "create_ecm_cms_core_folders.rb", "db/migrate/create_ecm_cms_core_folders.rb"
  migration_template "create_ecm_cms_core_templates.rb", "db/migrate/create_ecm_cms_core_templates.rb"
end