Class: Solidus::Auth::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Solidus::Auth::Generators::InstallGenerator
- Defined in:
- lib/generators/solidus/auth/install/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_migrations ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/generators/solidus/auth/install/install_generator.rb', line 20 def add_migrations admin_email = [:admin_email] || ([:interactive] && ask("Email:", default: '[email protected]')) admin_password = [:admin_password] || ([:interactive] && ask("Password:", default: 'test123')) = [] << "ADMIN_EMAIL=#{admin_email}" if admin_email << "ADMIN_PASSWORD=#{admin_password}" if admin_password rake "railties:install:migrations FROM=solidus_auth #{.shelljoin}" end |
#generate_devise_key ⇒ Object
16 17 18 |
# File 'lib/generators/solidus/auth/install/install_generator.rb', line 16 def generate_devise_key template 'config/initializers/devise.rb', 'config/initializers/devise.rb', skip: true end |
#run_migrations ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/generators/solidus/auth/install/install_generator.rb', line 31 def run_migrations if [:skip_migrations] || [:auto_run_migrations] == false || # exclude nil [:interactive] && no?('Would you like to run the migrations now?') say_status :skip, 'Skipping rake db:migrate, don\'t forget to run it!', :yellow else rake 'db:migrate' end end |