mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
Add fallbacks in migration for migrating locally with RAILS_ENV=test
Instances have these preference values set, but when running this migration locally with RAILS_ENV=test, the preference does not exist in the database.
This commit is contained in:
@@ -25,11 +25,11 @@ class MigrateShippingTaxes < ActiveRecord::Migration
|
||||
end
|
||||
|
||||
def instance_uses_shipping_tax?
|
||||
Spree::Preference.find_by(key: '/spree/app_configuration/shipment_inc_vat').value
|
||||
Spree::Preference.find_by(key: '/spree/app_configuration/shipment_inc_vat')&.value || false
|
||||
end
|
||||
|
||||
def instance_shipping_tax_rate
|
||||
Spree::Preference.find_by(key: '/spree/app_configuration/shipping_tax_rate').value
|
||||
Spree::Preference.find_by(key: '/spree/app_configuration/shipping_tax_rate')&.value || 0.0
|
||||
end
|
||||
|
||||
def shipping_tax_category
|
||||
|
||||
Reference in New Issue
Block a user