Class: Rockstart::PostgresGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::AppName, Rails::Generators::Migration
Defined in:
lib/generators/rockstart/postgres/postgres_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object

Implement the required interface for Rails::Generators::Migration.



8
9
10
11
# File 'lib/generators/rockstart/postgres/postgres_generator.rb', line 8

def self.next_migration_number(dirname)
  next_migration_number = current_migration_number(dirname) + 1
  ActiveRecord::Migration.next_migration_number(next_migration_number)
end

Instance Method Details

#copy_database_configObject



15
16
17
# File 'lib/generators/rockstart/postgres/postgres_generator.rb', line 15

def copy_database_config
  template "config/database.yml.tt", "config/database.yml"
end

#enable_uuid_supportObject



19
20
21
# File 'lib/generators/rockstart/postgres/postgres_generator.rb', line 19

def enable_uuid_support
  migration_template "migration.rb.tt", "db/migrate/enable_uuid.rb"
end