Class: Binda::Shopify::ImportsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/binda/shopify/imports_controller.rb

Instance Method Summary collapse

Instance Method Details

#importObject



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/binda/shopify/imports_controller.rb', line 6

def import
  importer = ::Binda::Shopify::Importer.new
  importer.run!

  structure_name = STRUCTURES.keys.first
  settings = ::Binda::Structure.find_by(slug: 'shopify-settings').board
  structure_slug = settings.get_string("#{settings.slug}-#{structure_name.to_s.gsub('_', '-')}").strip.parameterize
  structure = ::Binda::Structure.find_by slug: structure_slug
  redirect_to binda.structure_components_path( structure ), notice: 'Import was succesful!'
end