Module: DeviseConfigGenerator::AppHelper

Included in:
Devise::Generators::ConfigGenerator
Defined in:
lib/generators/devise/config/app_helper.rb

Instance Method Summary collapse

Instance Method Details

#mailer_configure!Object



35
36
37
38
# File 'lib/generators/devise/config/app_helper.rb', line 35

def mailer_configure!
  debug! "Configuring: devise mailer"            
  insert_application_config "action_mailer.default_url_options = { :host => 'localhost:3000' }"
end

#orm_configure!Object

inside ‘config/initializers/devise.rb’ change to: require ‘devise/orm/mongo_mapper’



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/generators/devise/config/app_helper.rb', line 13

def orm_configure!
  return if orm == :active_record
  debug! "Configuring orm: [#{orm}]"
  
  if !devise_initializer?        
    say "WARNING: initializer/devise.rb not found", :yellow
    return
  end
    
  if !has_statement?(orm_replacement)
    debug! "require 'devise/orm/#{orm}' already in devise.rb initializer"
    return
  end

  if !has_devise_orm_statement?
    say "WARNING: devise/orm statement not found in devise.rb initializer", :yellow
    return
  end
  
  replace_initializer_content :devise,  :where => orm_statement, :with => orm_replacement
end