Class: SolidusMollie::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SolidusMollie::Generators::InstallGenerator
- Defined in:
- lib/generators/solidus_mollie/install/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_initializer ⇒ Object
12 13 14 |
# File 'lib/generators/solidus_mollie/install/install_generator.rb', line 12 def copy_initializer template 'initializer.rb', 'config/initializers/solidus_mollie.rb' end |
#copy_migrations ⇒ Object
16 17 18 |
# File 'lib/generators/solidus_mollie/install/install_generator.rb', line 16 def copy_migrations rake 'railties:install:migrations FROM=solidus_mollie' end |
#run_migrations ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/solidus_mollie/install/install_generator.rb', line 20 def run_migrations run_migrations = [:auto_run_migrations] || ['', 'y', 'Y'].include?(ask('Run migrations now? [Yn]')) if run_migrations rake 'db:migrate' else say_status :skip, 'migrations (run `rails db:migrate` later)', :yellow end end |
#show_readme ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/generators/solidus_mollie/install/install_generator.rb', line 30 def show_readme say <<~MSG, :green solidus_mollie installed. Next steps: 1. Add a payment method in the admin (Configuration -> Payment Methods -> New), choosing "SolidusMollie::PaymentMethod" as the provider, and paste your Mollie API key (test_... or live_...). 2. Make sure your store is reachable over HTTPS at a public URL so Mollie can reach the webhook at /mollie/webhook (use a tunnel like ngrok in dev). MSG end |