Class: CommandProposal::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- CommandProposal::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/command_proposal/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/generators/command_proposal/install/install_generator.rb', line 10 def self.next_migration_number(path) unless @prev_migration_nr @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i else @prev_migration_nr += 1 end @prev_migration_nr.to_s end |
Instance Method Details
#copy_migrations ⇒ Object
19 20 21 |
# File 'lib/generators/command_proposal/install/install_generator.rb', line 19 def copy_migrations migration_template "install_command_proposal.rb", "db/migrate/install_command_proposal.rb" end |
#create_initializer_file ⇒ Object
23 24 25 |
# File 'lib/generators/command_proposal/install/install_generator.rb', line 23 def create_initializer_file copy_file "initializer.rb", "config/initializers/command_proposal.rb" end |