Class: ActiveRecord::Generators::MeritGenerator

Inherits:
Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/active_record/merit_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/merit_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
# File 'lib/generators/active_record/merit_generator.rb', line 15

def copy_migrations_and_model
  migration_template 'add_merit_fields_to_model.rb',
                     "db/migrate/add_merit_fields_to_#{table_name}.rb"
end

#migration_versionObject


20
21
22
# File 'lib/generators/active_record/merit_generator.rb', line 20

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