Class: ActionModels::TargetsOneParentGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
SuperScaffoldBase
Defined in:
lib/generators/super_scaffold/action_models/targets_one_parent/targets_one_parent_generator.rb

Instance Method Summary collapse

Instance Method Details

#generateObject



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/generators/super_scaffold/action_models/targets_one_parent/targets_one_parent_generator.rb', line 24

def generate
  if defined?(BulletTrain::ActionModels)
    # We add the name of the specific super_scaffolding command that we want to
    # invoke to the beginning of the argument string.
    ARGV.unshift "action-models:targets-one-parent"
    BulletTrain::SuperScaffolding::Runner.new.run
  else
    puts "You must have Action Models installed if you want to use this generator.".red
    puts "Please refer to the documentation for more information: https://bullettrain.co/docs/action-models"
  end
end