Class: EasyAdmin::Generators::TwoFactorGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/easy_admin/two_factor/two_factor_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_migrationObject



10
11
12
13
14
15
# File 'lib/generators/easy_admin/two_factor/two_factor_generator.rb', line 10

def create_migration
  timestamp = Time.current.utc.strftime("%Y%m%d%H%M%S")
  migration_file = "#{timestamp}_add_two_factor_to_easy_admin_admin_users.rb"
  
  template 'migration.rb', "db/migrate/#{migration_file}"
end

#show_readmeObject



17
18
19
# File 'lib/generators/easy_admin/two_factor/two_factor_generator.rb', line 17

def show_readme
  readme "README" if behavior == :invoke
end