Class: ActiveRecord::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/active_record/install_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/install_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
24
25
26
27
28
29
30
# File 'lib/generators/active_record/install_generator.rb', line 15

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

  migration_template 'create_merit_activity_logs.rb',
                     'db/migrate/create_merit_activity_logs.rb'

  migration_template 'create_sashes.rb',
                     'db/migrate/create_sashes.rb'

  migration_template 'create_badges_sashes.rb',
                     'db/migrate/create_badges_sashes.rb'

  migration_template 'create_scores_and_points.rb',
                     'db/migrate/create_scores_and_points.rb'
end

#migration_versionObject


32
33
34
# File 'lib/generators/active_record/install_generator.rb', line 32

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