Files
openfoodnetwork/app/services/default_shipping_category.rb
Luis Ramos e52937c113 Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00

16 lines
350 B
Ruby

# frozen_string_literal: true
# Encapsulates the concept of default stock location in creation of a product or a shipping method.
class DefaultShippingCategory
NAME = 'Default'
def self.create!
Spree::ShippingCategory.create!(name: NAME)
end
def self.find_or_create
Spree::ShippingCategory.find_or_create_by(name: NAME)
end
end