Class: Mongoid::Generators::DeviseGoogleAuthenticatorGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Mongoid::Generators::DeviseGoogleAuthenticatorGenerator
- Includes:
- Devise::Generators::OrmHelpers
- Defined in:
- lib/generators/mongoid/devise_google_authenticator_generator.rb
Instance Method Summary collapse
Instance Method Details
#inject_field_types ⇒ Object
9 10 11 |
# File 'lib/generators/mongoid/devise_google_authenticator_generator.rb', line 9 def inject_field_types inject_into_file model_path, migration_data, :after => "include Mongoid::Document\n" if model_exists? end |
#migration_data ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/generators/mongoid/devise_google_authenticator_generator.rb', line 13 def migration_data <<RUBY # Google Authenticator field :gauth_secret, :type => String field :gauth_enabled, :type => Boolean, :default => 'f' field :gauth_tmp, :type => String field :gauth_tmp_datetime, :type => DateTime RUBY end |