Class: FeatureBox::Generators::ExistingGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
GeneratorBase
Defined in:
lib/generators/feature_box/existing_generator.rb

Instance Method Summary collapse

Methods included from GeneratorBase

#copy_migrations, included, #trim, #trim_f

Instance Method Details

#feature_box_installObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/feature_box/existing_generator.rb', line 7

def feature_box_install
  #name of the User model
  @model_name = file_name || "User"
  @model_name = @model_name.camelize
  #variable for templates
  @has_devise = true

  #migrate
  copy_migrations [/00_.*/,/01_.*/,/02_.*/,/03_.*/,/06_.*/]
  rake  "db:migrate"

  #route
  route "mount FeatureBox::Engine => '/feature_box'"
  
  #initializer
  template "initializers/initializer.rb", "config/initializers/feature_box.rb"
end