Class: ActiveAdminSimpleLife::SimpleConfigGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/active_admin_simple_life/simple_config_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_lib_dirObject



22
23
24
# File 'lib/generators/active_admin_simple_life/simple_config_generator.rb', line 22

def add_lib_dir
  copy_file "require_lib.rb", "config/initializers/require_lib.rb"
end

#copy_admin_fileObject



18
19
20
# File 'lib/generators/active_admin_simple_life/simple_config_generator.rb', line 18

def copy_admin_file
  copy_file "config_admin.rb", "app/admin/config.rb"
end

#copy_model_fileObject



13
14
15
16
# File 'lib/generators/active_admin_simple_life/simple_config_generator.rb', line 13

def copy_model_file
  remove_file "app/models/config.rb"
  copy_file "config_model.rb", "app/models/config.rb"
end

#extend_array_methodObject



26
27
28
# File 'lib/generators/active_admin_simple_life/simple_config_generator.rb', line 26

def extend_array_method
  copy_file "array.rb", "lib/array.rb"
end

#generate_migrationObject



9
10
11
# File 'lib/generators/active_admin_simple_life/simple_config_generator.rb', line 9

def generate_migration
  run "rails g model config title:string internal_name:string:index configurable:references{polymorphic} primitive:string:true"
end