Class: JpAddressComplement::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- JpAddressComplement::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/jp_address_complement/install_generator.rb
Overview
rails g jp_address_complement:install で呼び出されるジェネレーター
住所テーブル用マイグレーションファイルを利用者アプリの db/migrate/ に生成する
Class Method Summary collapse
-
.next_migration_number(dirname) ⇒ Object
Rails::Generators::Base の RBS に next_migration_number 等が未定義のため steep:ignore.
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
Rails::Generators::Base の RBS に next_migration_number 等が未定義のため steep:ignore
20 21 22 23 |
# File 'lib/generators/jp_address_complement/install_generator.rb', line 20 def self.next_migration_number(dirname) next_migration_number = current_migration_number(dirname) + 1 # steep:ignore ActiveRecord::Migration.next_migration_number(next_migration_number) # steep:ignore end |
Instance Method Details
#create_migration_file ⇒ Object
26 27 28 29 30 31 |
# File 'lib/generators/jp_address_complement/install_generator.rb', line 26 def create_migration_file migration_template( # steep:ignore 'create_jp_address_complement_postal_codes.rb.erb', 'db/migrate/create_jp_address_complement_postal_codes.rb' ) end |