Class: FullMetalBody::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- FullMetalBody::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/full_metal_body/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(_path) ⇒ Object
9 10 11 |
# File 'lib/generators/full_metal_body/install/install_generator.rb', line 9 def self.next_migration_number(_path) Time.now.utc.strftime('%Y%m%d%H%M%S') end |
Instance Method Details
#create_migration_file ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/generators/full_metal_body/install/install_generator.rb', line 13 def create_migration_file template = 'create_blocked_actions' migration_dir = File.('db/migrate') migration_template( "#{template}.rb.erb", "db/migrate/#{template}.rb", migration_version: migration_version, ) end |
#create_whitelist_dir ⇒ Object
23 24 25 |
# File 'lib/generators/full_metal_body/install/install_generator.rb', line 23 def create_whitelist_dir empty_directory('config/whitelist') end |