Class: ShoppingCart::ConfigGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ShoppingCart::ConfigGenerator
- Defined in:
- lib/generators/shopping_cart/config_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_migrations ⇒ Object
12 13 14 |
# File 'lib/generators/shopping_cart/config_generator.rb', line 12 def copy_migrations rake 'shopping_cart:install:migrations' end |
#create_initializer_file ⇒ Object
5 6 7 8 |
# File 'lib/generators/shopping_cart/config_generator.rb', line 5 def create_initializer_file create_file "config/initializers/shopping_cart.rb", "ShoppingCart.user_class = 'User'\n#ShoppingCart.order_steps = %i(shipping payment)" end |
#mount_routes ⇒ Object
18 19 20 21 22 |
# File 'lib/generators/shopping_cart/config_generator.rb', line 18 def mount_routes inject_into_file 'config/routes.rb', before: "root" do "mount ShoppingCart::Engine => '/shopping_cart'\n" end end |