Class: Schienenzeppelin::AddOns::Devise
- Inherits:
-
Schienenzeppelin::AddOn
- Object
- Rails::Generators::Base
- Schienenzeppelin::AddOn
- Schienenzeppelin::AddOns::Devise
- Defined in:
- lib/schienenzeppelin/addons/devise.rb
Instance Attribute Summary
Attributes inherited from Schienenzeppelin::AddOn
Instance Method Summary collapse
Methods inherited from Schienenzeppelin::AddOn
apply, default_source_root, dependencies, get, identifier, #initialize
Constructor Details
This class inherits a constructor from Schienenzeppelin::AddOn
Instance Method Details
#apply ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/schienenzeppelin/addons/devise.rb', line 8 def apply generate('devise:install', capture: true) generate(:devise, 'User', 'name', 'admin:boolean', capture: true) directory('app/views/devise', 'app/views/devise') if uses?(:views) inject_into_file 'config/environments/development.rb', before: /^end/ do <<-RUBY # Enable devise mailer config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } RUBY end gsub_file 'config/initializers/devise.rb', /# config.pepper = .+/, " # config.pepper = 'pepper'" gsub_file 'config/initializers/devise.rb', /# config.secret_key = .+/, " # config.secret_key = 'secret_key'" db_changes end |