Class: AppManager::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- AppManager::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/app_manager/install/install_generator.rb
Class Method Summary collapse
-
.next_migration_number(dir) ⇒ Object
for generating a timestamp when using ‘create_migration`.
Instance Method Summary collapse
- #create_app_manager_initializer ⇒ Object
- #create_discount_table_migration ⇒ Object
- #create_external_charge_field ⇒ Object
- #create_fail_safe ⇒ Object
- #create_plan_trial_grandfathered_to_shops_migration ⇒ Object
- #mount_engine ⇒ Object
Class Method Details
.next_migration_number(dir) ⇒ Object
for generating a timestamp when using ‘create_migration`
61 62 63 |
# File 'lib/generators/app_manager/install/install_generator.rb', line 61 def next_migration_number(dir) ActiveRecord::Generators::Base.next_migration_number(dir) end |
Instance Method Details
#create_app_manager_initializer ⇒ Object
14 15 16 |
# File 'lib/generators/app_manager/install/install_generator.rb', line 14 def create_app_manager_initializer template("app_manager.rb", "config/initializers/app_manager.rb") end |
#create_discount_table_migration ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/generators/app_manager/install/install_generator.rb', line 42 def create_discount_table_migration if self.class.migration_exists?("db/app_manager", "add_discount_tables") say_status("skipped", "Migration add_discount_tables.rb already exists") else migration_template("add_discount_tables.erb", "db/app_manager/add_discount_tables.rb") end end |
#create_external_charge_field ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/generators/app_manager/install/install_generator.rb', line 34 def create_external_charge_field if self.class.migration_exists?("db/app_manager", "add_external_charge_field") say_status("skipped", "Migration add_external_charge_field.rb already exists") else migration_template("add_external_charge_field.erb", "db/app_manager/add_external_charge_field.rb") end end |
#create_fail_safe ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/generators/app_manager/install/install_generator.rb', line 26 def create_fail_safe if self.class.migration_exists?("db/app_manager", "failsafe_tables") say_status("skipped", "Migration add_fail_safe.rb already exists") else migration_template("failsafe_tables.erb", "db/app_manager/add_fail_safe.rb") end end |
#create_plan_trial_grandfathered_to_shops_migration ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/generators/app_manager/install/install_generator.rb', line 18 def create_plan_trial_grandfathered_to_shops_migration if self.class.migration_exists?("db/migrate", "add_plan_trial_grandfathered_to_shops") say_status("skipped", "Migration add_plan_trial_grandfathered_to_shops.rb already exists") else migration_template("add_plan_trial_grandfathered_to_shops.erb", "db/migrate/add_plan_trial_grandfathered_to_shops.rb") end end |
#mount_engine ⇒ Object
10 11 12 |
# File 'lib/generators/app_manager/install/install_generator.rb', line 10 def mount_engine route("mount AppManager::Engine, at: '/'") end |