Class: Splut::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



12
13
14
# File 'lib/generators/splut/install_generator.rb', line 12

def self.next_migration_number(path)
  Time.now.utc.strftime("%Y%m%d%H%M%S")
end

Instance Method Details

#create_splut_migrationObject



17
18
19
# File 'lib/generators/splut/install_generator.rb', line 17

def create_splut_migration
  migration_template "create_splut_tables.rb",  "db/migrate/create_splut_tables.rb"
end

#migration_versionObject



21
22
23
# File 'lib/generators/splut/install_generator.rb', line 21

def migration_version
  "[#{ActiveRecord::Migration.current_version}]" if ActiveRecord::Migration.respond_to?(:current_version)
end