class TwoFactorAuth::Generators::InstallGenerator

Public Class Methods

next_migration_number(path) click to toggle source
# 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

Public Instance Methods

add_route() click to toggle source
# File lib/generators/two_factor_auth/install_generator.rb, line 19
def add_route
  route "two_factor_auth_for :users"
end
copy_initializer() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# File lib/generators/two_factor_auth/install_generator.rb, line 31
def show_readme
  readme "README" if behavior == :invoke
end