Class: ConsistencyCheck::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/consistency_check/install/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



12
13
14
15
# File 'lib/generators/consistency_check/install/install_generator.rb', line 12

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

Instance Method Details

#create_jobObject



26
27
28
29
# File 'lib/generators/consistency_check/install/install_generator.rb', line 26

def create_job
  fname = 'app/jobs/consistency_check/definitions.rb'
  template('jobs/consistency_check/definitions.rb.erb', fname)
end

#create_migrationsObject



17
18
19
# File 'lib/generators/consistency_check/install/install_generator.rb', line 17

def create_migrations
  migration_template 'migrations/create_consistency_check_results.rb.erb', 'db/migrate/create_consistency_check_results.rb'
end

#create_modelObject



21
22
23
24
# File 'lib/generators/consistency_check/install/install_generator.rb', line 21

def create_model
  fname = 'app/models/consistency_check_result.rb'
  template('models/consistency_check_result.rb.erb', fname)
end