Class: DeviseActiveDirectoryAuthenticatable::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/devise_active_directory_authenticatable/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_default_devise_settingsObject



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_controllerObject



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 options.add_rescue?
end

#update_group_modelObject



19
20
21
# File 'lib/generators/devise_active_directory_authenticatable/install_generator.rb', line 19

def update_group_model
  inject_into_class "app/models/#{options.group_model}.rb", options.group_model, "devise :ad_group" if options.update_model?
end

#update_user_modelObject



15
16
17
# File 'lib/generators/devise_active_directory_authenticatable/install_generator.rb', line 15

def update_user_model
  gsub_file "app/models/#{options.user_model}.rb", /:database_authenticatable/, ":ad_user" if options.update_model?
end