Class: Tramway::Core::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/tramway/core/generators/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



13
14
15
16
# File 'lib/tramway/core/generators/install_generator.rb', line 13

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

#copy_initializerObject



18
19
20
21
22
23
24
25
26
# File 'lib/tramway/core/generators/install_generator.rb', line 18

def copy_initializer
  simple_form_files = %w[simple_form simple_form_bootstrap]
  simple_form_files.each do |file|
    copy_file(
      "/#{File.dirname __dir__}/generators/templates/initializers/#{file}.rb",
      "config/initializers/#{file}.rb"
    )
  end
end

#run_other_generatorsObject



9
10
11
# File 'lib/tramway/core/generators/install_generator.rb', line 9

def run_other_generators
  generate 'audited:install'
end