Class: Testimonials::Generators::NpsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Testimonials::Generators::NpsGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/generators/testimonials/nps/nps_generator.rb
Overview
For apps that installed with --skip-nps and later want the 0–10 survey: creates the testimonials_nps_responses table. A full install already has it. Additive and safe — nothing reads the table until config.nps is true.
bin/rails generate testimonials:nps && bin/rails db:migrate
Instance Method Summary collapse
Instance Method Details
#create_migration_file ⇒ Object
20 21 22 23 |
# File 'lib/generators/testimonials/nps/nps_generator.rb', line 20 def create_migration_file migration_template 'create_testimonials_nps_responses.rb.tt', 'db/migrate/create_testimonials_nps_responses.rb' end |
#post_install ⇒ Object
25 26 27 28 |
# File 'lib/generators/testimonials/nps/nps_generator.rb', line 25 def post_install say "\nNPS table queued. Run `rails db:migrate`, then set", :green say 'config.nps = true in config/initializers/testimonials.rb to turn the flow on.' end |