Class: Catalogs::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Catalogs::InstallGenerator
- Defined in:
- lib/generators/catalogs/install_generator.rb
Instance Method Summary collapse
- #copy_locale_file ⇒ Object
- #copy_migrations ⇒ Object
- #include_engine_helper_methods ⇒ Object
- #run_migrations ⇒ Object
Instance Method Details
#copy_locale_file ⇒ Object
22 23 24 |
# File 'lib/generators/catalogs/install_generator.rb', line 22 def copy_locale_file copy_file "catalogs.en.yml", "config/locales/catalogs.en.yml" end |
#copy_migrations ⇒ Object
26 27 28 |
# File 'lib/generators/catalogs/install_generator.rb', line 26 def copy_migrations rake "catalogs:install:migrations" end |
#include_engine_helper_methods ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/generators/catalogs/install_generator.rb', line 9 def include_engine_helper_methods code = " helper Catalogs::Engine.helpers\n RUBY\n\n inject_into_file(\n \"app/controllers/application_controller.rb\",\n after: \"class ApplicationController < ActionController::Base\\n\"\n ) do\n code\n end\nend\n" |
#run_migrations ⇒ Object
30 31 32 |
# File 'lib/generators/catalogs/install_generator.rb', line 30 def run_migrations rake "db:migrate" end |