Class: Heya::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



20
21
22
23
# File 'lib/generators/heya/install/install_generator.rb', line 20

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

Instance Method Details

#copy_application_campaign_templateObject



16
17
18
# File 'lib/generators/heya/install/install_generator.rb', line 16

def copy_application_campaign_template
  template "application_campaign.rb", "app/campaigns/application_campaign.rb"
end

#copy_initializer_fileObject



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

def copy_initializer_file
  copy_file "initializer.rb", "config/initializers/heya.rb"
end

#copy_migrationsObject



8
9
10
# File 'lib/generators/heya/install/install_generator.rb', line 8

def copy_migrations
  migration_template "migration.rb", "db/migrate/create_heya_tables.rb"
end