app/controllers/spree/api/retailops/catalog_controller.rb
# Taxon upserter does memoing internally due to common prefixes
Taxon upserter does memoing internally due to common prefixes
Taxon upserter does memoing internally due to common prefixes
def upsert_taxon_path(path)
            taxonomy_name, *taxon_names = *path
            taxonomy = memo :upsert_taxonomy, taxonomy_name do
              Taxonomy.find_or_create_by!(name: taxonomy_name)
            end
            taxon = taxonomy.root
            taxon_names.each do |taxon_name|
              taxon = memo :upsert_taxon, (taxon && taxon.id), taxon_name do
                taxonomy.taxons.find_or_create_by!(parent_id: taxon.id, name: taxon_name)
              end
            end
            return taxon
          end
def upsert_taxon_path ( path ) taxonomy_name , * taxon_names = * path taxonomy = memo :upsert_taxonomy , taxonomy_name do Taxonomy . find_or_create_by! ( name : taxonomy_name ) end taxon = taxonomy . root taxon_names . each do | taxon_name | taxon = memo :upsert_taxon , ( taxon && taxon . id ) , taxon_name do taxonomy . taxons . find_or_create_by! ( parent_id : taxon . id , name : taxon_name ) end end return taxon end
Taxon upserter does memoing internally due to common prefixes
Taxon upserter does memoing internally due to common prefixes
path
<not_specific>