class Spina::Shop::InstallGenerator
Public Instance Methods
copy_migrations()
click to toggle source
# File lib/generators/spina/shop/install_generator.rb, line 5 def copy_migrations return if Rails.env.production? rake 'spina_shop:install:migrations' end
default_product_category()
click to toggle source
# File lib/generators/spina/shop/install_generator.rb, line 18 def default_product_category default_product_category = Spina::Shop::ProductCategory.where(name: 'Default').first_or_initialize default_product_category.save end
default_sales_category()
click to toggle source
# File lib/generators/spina/shop/install_generator.rb, line 23 def default_sales_category default_sales_category = Spina::Shop::SalesCategory.where(name: "Default").first_or_initialize default_sales_category.codes = { world: { default: "0" } } default_sales_category.save end
feedback()
click to toggle source
# File lib/generators/spina/shop/install_generator.rb, line 33 def feedback puts puts ' Your Spina Shop has been succesfully installed! ' puts puts ' Restart your server and visit http://localhost:3000 in your browser!' puts " The admin backend is located at http://localhost:3000/#{Spina.config.backend_path}." puts end
import_countries()
click to toggle source
# File lib/generators/spina/shop/install_generator.rb, line 14 def import_countries rake 'spina_shop:import_countries' end
run_migrations()
click to toggle source
# File lib/generators/spina/shop/install_generator.rb, line 10 def run_migrations rake 'db:migrate' end