Class: DeviseActiveDirectoryAuthenticatable::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- DeviseActiveDirectoryAuthenticatable::InstallGenerator
- Defined in:
- lib/generators/devise_active_directory_authenticatable/install_generator.rb
Instance Method Summary collapse
- #create_default_devise_settings ⇒ Object
- #update_application_controller ⇒ Object
- #update_group_model ⇒ Object
- #update_user_model ⇒ Object
Instance Method Details
#create_default_devise_settings ⇒ Object
11 12 13 |
# File 'lib/generators/devise_active_directory_authenticatable/install_generator.rb', line 11 def create_default_devise_settings inject_into_file "config/initializers/devise.rb", default_devise_settings, :after => "Devise.setup do |config|\n" end |
#update_application_controller ⇒ Object
23 24 25 |
# File 'lib/generators/devise_active_directory_authenticatable/install_generator.rb', line 23 def update_application_controller inject_into_class "app/controllers/application_controller.rb", ApplicationController, rescue_from_exception if .add_rescue? end |
#update_group_model ⇒ Object
19 20 21 |
# File 'lib/generators/devise_active_directory_authenticatable/install_generator.rb', line 19 def update_group_model inject_into_class "app/models/#{.group_model}.rb", .group_model, "devise :ad_group" if .update_model? end |
#update_user_model ⇒ Object
15 16 17 |
# File 'lib/generators/devise_active_directory_authenticatable/install_generator.rb', line 15 def update_user_model gsub_file "app/models/#{.user_model}.rb", /:database_authenticatable/, ":ad_user" if .update_model? end |