Class: NtiReceiptBuilder::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- NtiReceiptBuilder::Generators::InstallGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/generators/nti_receipt_builder/install_generator.rb
Overview
rails generate nti_receipt_builder:install
Instance Method Summary collapse
- #create_initializer ⇒ Object
- #create_migration_file ⇒ Object
-
#create_turbo_stream_helpers ⇒ Object
Only for hosts that do not already extend Turbo::Streams::TagBuilder.
Instance Method Details
#create_initializer ⇒ Object
17 18 19 |
# File 'lib/generators/nti_receipt_builder/install_generator.rb', line 17 def create_initializer template 'initializer.rb', 'config/initializers/nti_receipt_builder.rb' end |
#create_migration_file ⇒ Object
21 22 23 24 |
# File 'lib/generators/nti_receipt_builder/install_generator.rb', line 21 def create_migration_file migration_template 'create_nti_receipt_templates.rb', 'db/migrate/create_nti_receipt_templates.rb' end |
#create_turbo_stream_helpers ⇒ Object
Only for hosts that do not already extend Turbo::Streams::TagBuilder. A host that already defines open_modal has its own conventions; overwriting them would be wrong.
28 29 30 31 32 33 34 35 |
# File 'lib/generators/nti_receipt_builder/install_generator.rb', line 28 def create_turbo_stream_helpers if turbo_stream_helpers_present? say_status :skip, 'config/initializers/turbo_stream_tags.rb (host already defines open_modal)', :yellow return end template 'turbo_stream_tags.rb', 'config/initializers/turbo_stream_tags.rb' end |