Browse Source

generate migration after adding :two_factor_authentication

for_activeadmin
Carlos Vilhena 13 years ago
parent
commit
811e91079d
  1. 5
      lib/generators/two_factor_authentication/two_factor_authentication_generator.rb

5
lib/generators/two_factor_authentication/two_factor_authentication_generator.rb

@ -5,12 +5,13 @@ module TwoFactorAuthenticatable
desc "Add :two_factor_authenticable directive in the given model. Also generate migration for ActiveRecord"
hook_for :orm
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

Loading…
Cancel
Save