Class: Rodauth::Rails::Generators::MigrationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Rodauth::Rails::Generators::MigrationGenerator
- Includes:
- ActiveRecord::Generators::Migration, Rails::Generators::Migration
- Defined in:
- lib/generators/rodauth/migration_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_rodauth_migration ⇒ Object
22 23 24 25 26 |
# File 'lib/generators/rodauth/migration_generator.rb', line 22 def create_rodauth_migration return unless validate_features migration_template "db/migrate/create_rodauth.rb", File.join(db_migrate_path, "#{migration_name}.rb") end |
#show_configuration ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/generators/rodauth/migration_generator.rb', line 28 def show_configuration # skip if called from install generator, it already adds configuration return if current_command_chain.include?(:generate_rodauth_migration) return unless [:prefix] && behavior == :invoke configuration = CONFIGURATION.values_at(*features.map(&:to_sym)) .flat_map(&:to_a) .map { |config, format| "#{config} :#{format % { plural: table_prefix.pluralize, singular: table_prefix }}" } .join("\n") .indent(2) say "\nCopy the following lines into your Rodauth configuration:\n\n#{configuration}" end |