Sha256: 6d30062d66fdad639cb3fa41ff8a210a47ee659970ce6dce3b4209603a7617e4

Contents?: true

Size: 562 Bytes

Versions: 14

Compression:

Stored size: 562 Bytes

Contents

module TwoFactorAuthenticatable
  module Generators
    class TwoFactorAuthenticationGenerator < Rails::Generators::NamedBase
      namespace "two_factor_authentication"

      desc "Adds :two_factor_authenticable directive in the given model. It also generates an active record migration."

      def inject_two_factor_authentication_content
        path = File.join("app", "models", "#{file_path}.rb")
        inject_into_file(path, "two_factor_authenticatable, :", :after => "devise :") if File.exists?(path)
      end

      hook_for :orm

    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
devise_two_factor_authentication-3.0.0 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-2.2.0 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-2.1.1 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-2.1.0 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-2.0.1 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-2.0.0 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-1.1.5 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-1.1.4 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-1.1.3 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-1.1.1 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-1.1 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-1.0 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-0.2 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
two_factor_authentication-0.0.1 lib/generators/two_factor_authentication/two_factor_authentication_generator.rb