Sha256: c09410f7a873a67c5322f7ee6bfda631b624e597083ec0c346713847ffd6d7bb

Contents?: true

Size: 455 Bytes

Versions: 6

Compression:

Stored size: 455 Bytes

Contents

module DeviseTwoFactor
  module Generators
    class DeviseTwoFactorGenerator < Rails::Generators::NamedBase
      namespace 'devise_two_factor'

      desc 'Add :two_factorable directive in the given model.'

      def inject_devise_two_factor_content
        path = File.join('app', 'models', "#{file_path}.rb")
        inject_into_file(path, 'two_factorable, :', after: 'devise :') if File.exist?(path)
      end

      hook_for :orm
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
devise-2fa-0.4.1 lib/generators/devise_two_factor/devise_two_factor_generator.rb
devise-2fa-0.4.0 lib/generators/devise_two_factor/devise_two_factor_generator.rb
devise-2fa-0.2.1 lib/generators/devise_two_factor/devise_two_factor_generator.rb
devise-2fa-0.2.0 lib/generators/devise_two_factor/devise_two_factor_generator.rb
devise-2fa-0.1.1 lib/generators/devise_two_factor/devise_two_factor_generator.rb
devise-2fa-0.1.0 lib/generators/devise_two_factor/devise_two_factor_generator.rb