From 51ff05c3de3500fdc6aee55e2919646028055286 Mon Sep 17 00:00:00 2001 From: Adnan Abdulally Date: Fri, 29 Jan 2021 10:24:19 -0800 Subject: Rename module SolidusTaxJar to SolidusTaxjar In order for the Zeitwerk loader to properly identity our classes from the file names, we should remove camel casing from this name that isn't consistent with underscores in the file name itself. Co-authored-by: Nick Van Doorn --- lib/super_good/solidus_taxjar.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/super_good/solidus_taxjar.rb') diff --git a/lib/super_good/solidus_taxjar.rb b/lib/super_good/solidus_taxjar.rb index 7bdeb03..9c773be 100644 --- a/lib/super_good/solidus_taxjar.rb +++ b/lib/super_good/solidus_taxjar.rb @@ -12,7 +12,7 @@ require "super_good/solidus_taxjar/discount_calculator" require "super_good/solidus_taxjar/addresses" module SuperGood - module SolidusTaxJar + module SolidusTaxjar class << self attr_accessor :cache_duration attr_accessor :cache_key @@ -28,7 +28,7 @@ module SuperGood attr_accessor :test_mode def api - ::SuperGood::SolidusTaxJar::API.new + ::SuperGood::SolidusTaxjar::API.new end end @@ -38,7 +38,7 @@ module SuperGood APIParams.send("#{record_type}_params", record).to_json } self.custom_order_params = ->(order) { {} } - self.discount_calculator = ::SuperGood::SolidusTaxJar::DiscountCalculator + self.discount_calculator = ::SuperGood::SolidusTaxjar::DiscountCalculator self.exception_handler = ->(e) { Rails.logger.error "An error occurred while fetching TaxJar tax rates - #{e}: #{e.message}" } -- cgit v1.2.3 From 37fa5e7c81ee44012c86eabb140db760d55eae3b Mon Sep 17 00:00:00 2001 From: Adnan Abdulally Date: Fri, 29 Jan 2021 10:27:06 -0800 Subject: Rename classes that have API in their name to Api This done so Zeitwerk can correctly can correctly load the class from the filename. Co-authored-by: Nick Van Doorn --- lib/super_good/solidus_taxjar.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/super_good/solidus_taxjar.rb') diff --git a/lib/super_good/solidus_taxjar.rb b/lib/super_good/solidus_taxjar.rb index 9c773be..36b5d85 100644 --- a/lib/super_good/solidus_taxjar.rb +++ b/lib/super_good/solidus_taxjar.rb @@ -28,14 +28,14 @@ module SuperGood attr_accessor :test_mode def api - ::SuperGood::SolidusTaxjar::API.new + ::SuperGood::SolidusTaxjar::Api.new end end self.cache_duration = 3.hours self.cache_key = ->(record) { record_type = record.class.name.demodulize.underscore - APIParams.send("#{record_type}_params", record).to_json + ApiParams.send("#{record_type}_params", record).to_json } self.custom_order_params = ->(order) { {} } self.discount_calculator = ::SuperGood::SolidusTaxjar::DiscountCalculator -- cgit v1.2.3