Class: ActiveAdminSimpleLife::SimpleConfigGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActiveAdminSimpleLife::SimpleConfigGenerator
- Defined in:
- lib/generators/active_admin_simple_life/simple_config_generator.rb
Instance Method Summary collapse
- #add_lib_dir ⇒ Object
- #copy_admin_file ⇒ Object
- #copy_model_file ⇒ Object
- #extend_array_method ⇒ Object
- #generate_migration ⇒ Object
Instance Method Details
#add_lib_dir ⇒ Object
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_file ⇒ Object
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_file ⇒ Object
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_method ⇒ Object
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_migration ⇒ Object
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 |