Class: ActiveRecord::Generators::RemoveGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object


11
12
13
# File 'lib/generators/active_record/remove_generator.rb', line 11

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

Instance Method Details

#copy_migrations_and_modelObject


15
16
17
18
19
20
21
22
23
# File 'lib/generators/active_record/remove_generator.rb', line 15

def copy_migrations_and_model
  migration_template 'remove_merit_tables.rb',
                     'db/migrate/remove_merit_tables.rb'

  migration_template(
    'remove_merit_fields_from_model.rb',
    "db/migrate/remove_merit_fields_from_#{table_name}.rb"
  )
end

#migration_versionObject


25
26
27
# File 'lib/generators/active_record/remove_generator.rb', line 25

def migration_version
  "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
end