Class: RecordLoader::ProductCatalogueLoader

Inherits:
ApplicationRecordLoader show all
Defined in:
lib/record_loader/product_catalogue_loader.rb

Overview

Creates the specified product catalogues if they are not present

Instance Method Summary collapse

Methods inherited from ApplicationRecordLoader

#wip_list

Instance Method Details

#create_or_update!(name, options) ⇒ Object



12
13
14
# File 'lib/record_loader/product_catalogue_loader.rb', line 12

def create_or_update!(name, options)
  ProductCatalogue.create_with(options).find_or_create_by!(name:)
end