Class: TwoFactorAuth::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- TwoFactorAuth::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/two_factor_auth/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
15 16 17 |
# File 'lib/generators/two_factor_auth/install_generator.rb', line 15 def self.next_migration_number(path) Time.now.utc.strftime("%Y%m%d%H%M%S") end |
Instance Method Details
#add_route ⇒ Object
19 20 21 |
# File 'lib/generators/two_factor_auth/install_generator.rb', line 19 def add_route route "two_factor_auth_for :users" end |
#copy_initializer ⇒ Object
27 28 29 |
# File 'lib/generators/two_factor_auth/install_generator.rb', line 27 def copy_initializer copy_file "initializer.rb", "config/initializers/two_factor_auth.rb" end |
#copy_migration ⇒ Object
23 24 25 |
# File 'lib/generators/two_factor_auth/install_generator.rb', line 23 def copy_migration migration_template "migration.rb", "db/migrate/create_two_factor_auth_registrations.rb" end |
#show_readme ⇒ Object
31 32 33 |
# File 'lib/generators/two_factor_auth/install_generator.rb', line 31 def show_readme readme "README" if behavior == :invoke end |