valken-shipping 1.1.8 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f96335c5b53614036b3991c54ec307ace739a6991fbb3c1e4dd98a957a3afb6
4
- data.tar.gz: 5d7a5f6347d2edcd2d46e4053e78843c47055b64d076f448da69593dc097b3df
3
+ metadata.gz: c1b1ed71fdb852fdbd8b1ca1018fb950435b4860fe86fb6a06b6cff3b76da06d
4
+ data.tar.gz: 24da7f5bd45aee0254d206c949f7cac835fa74ee2e98d18135eb5cd046bc7c0f
5
5
  SHA512:
6
- metadata.gz: a449dc97ab566e2c2f7b30b40613b042497560ef503d7a9d4471029ead334b41001918436537942321c16f00d438502996d13fb3ac2859e0fbcab9b03807799e
7
- data.tar.gz: db9b1c8f6766e75284cb9023e606ae034867f14fd239316c7484ea7d514d255fb132dae2d1c978613226b38d50072942446554eb3be366fa3fc97fd093b25ba6
6
+ metadata.gz: fabbba71a4d896abddc6b05797d8cd8fbbaa5eb9a2fa3a2066a0e4f93b0559c5d097a99d3f3bece098b4a229adf5615acff7f5dc84a652bfe2cec62430e52515
7
+ data.tar.gz: 4173b8f446c15d72b96f4df7856739a2b1b6fdd20b647e0855de69de5906448bd00050cea9a8d9f315961d5bb042cbe71b43a25408b56ced44406350179e3af3
@@ -164,6 +164,9 @@ module Workarea
164
164
  # sorting the uniq delivery dates and reversing those delivery dates.
165
165
  uniq_delivery_dates = all_delivery_dates.compact.sort.uniq[0..2].reverse
166
166
 
167
+ # removing overnight. Assuming the 3rd option is always overnight
168
+ uniq_delivery_dates.pop if uniq_delivery_dates.length == 3
169
+
167
170
  # For each delivery dates, find cheapest rates and create shipping option and push
168
171
  uniq_delivery_dates.each_with_index do |date, index|
169
172
  selected_rates = rates.select {|rate| rate.delivery_date.present? && rate.delivery_date == date}
@@ -5,8 +5,7 @@ Workarea.configure do |config|
5
5
 
6
6
  config.shipping_rates = [
7
7
  {"Valken Express 3-Day" => "3 Business Days"},
8
- {"Valken Express 2-Day" => "2 Business Days"},
9
- {"Valken Overnight" => "Overnight"}
8
+ {"Valken Express 2-Day" => "2 Business Days"}
10
9
  ]
11
10
  config.ups_options = {"12"=> "Valken Express 3-Day", "01"=> "Valken Overnight", "02"=> "Valken Express 2-Day"}
12
11
  config.fedex_options = {"STANDARD_OVERNIGHT"=> "Valken Overnight", "FEDEX_2_DAY"=> "Valken Express 2-Day", "GROUND_HOME_DELIVERY"=> "Valken Express 3-Day"}
@@ -1,5 +1,5 @@
1
1
  module Valken
2
2
  module Shipping
3
- VERSION = '1.1.8'
3
+ VERSION = '1.1.9'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valken-shipping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - sushmitha02
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-25 00:00:00.000000000 Z
11
+ date: 2020-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails