Class: IronTrail::MigrationGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



32
33
34
# File 'lib/generators/iron_trail/migration_generator.rb', line 32

def self.next_migration_number(dirname)
  ActiveRecord::Generators::Base.next_migration_number(dirname)
end

Instance Method Details

#create_changes_migration_fileObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/generators/iron_trail/migration_generator.rb', line 13

def create_changes_migration_file
  migration_dir = File.expand_path("db/migrate")

  migration_template(
    "create_irontrail_changes.rb.erb",
    "db/migrate/create_irontrail_changes.rb"
  )

  migration_template(
    "create_irontrail_support_tables.rb.erb",
    "db/migrate/create_irontrail_support_tables.rb"
  )

  migration_template(
    "create_irontrail_trigger_function.rb.erb",
    "db/migrate/create_irontrail_trigger_function.rb"
  )
end