spree_core 4.0.0.beta → 4.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/spree/calculator/percent_on_line_item.rb +8 -1
- data/app/models/spree/order.rb +1 -1
- data/app/models/spree/order/address_book.rb +1 -1
- data/app/models/spree/shipping_method.rb +1 -1
- data/app/models/spree/variant.rb +1 -2
- data/lib/spree/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1e151381e092c35c7a9cf8860afc569afee679c44465209bbe1760ada4dd716
|
4
|
+
data.tar.gz: 71cb114b3a96d8e865c1d9bbed17e95c54764f71db1c1ca002d05510d27455cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a25734d828b63ffa3ea6db68681ddf0c590c7a516583f76b2c9b8eb300ab4943dbba82e0beac67f2ad1a7915e6bdbe6656c4382df2cc56981d34b98cbd23e1
|
7
|
+
data.tar.gz: 073535b1a83ada55a42a391ee4a68f74cd600e0ec41f2fdf7deb2c6657218aba51221cf09a451fe18d14c45003499ac4046ea7ce438c0bd56a0ca99b500eee4b
|
@@ -8,7 +8,14 @@ module Spree
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def compute(object)
|
11
|
-
(object.amount * preferred_percent
|
11
|
+
computed_amount = (object.amount * preferred_percent / 100).round(2)
|
12
|
+
|
13
|
+
# We don't want to cause the promotion adjustments to push the order into a negative total.
|
14
|
+
if computed_amount > object.amount
|
15
|
+
object.amount
|
16
|
+
else
|
17
|
+
computed_amount
|
18
|
+
end
|
12
19
|
end
|
13
20
|
end
|
14
21
|
end
|
data/app/models/spree/order.rb
CHANGED
@@ -128,7 +128,7 @@ module Spree
|
|
128
128
|
before_update :homogenize_line_item_currencies, if: :currency_changed?
|
129
129
|
|
130
130
|
with_options presence: true do
|
131
|
-
validates :number, length: { maximum: 32, allow_blank: true }, uniqueness: { allow_blank: true }
|
131
|
+
validates :number, length: { maximum: 32, allow_blank: true }, uniqueness: { allow_blank: true, case_sensitive: false }
|
132
132
|
validates :email, length: { maximum: 254, allow_blank: true }, email: { allow_blank: true }, if: :require_email
|
133
133
|
validates :item_count, numericality: { greater_than_or_equal_to: 0, less_than: 2**31, only_integer: true, allow_blank: true }
|
134
134
|
validates :store
|
data/app/models/spree/variant.rb
CHANGED
@@ -48,7 +48,7 @@ module Spree
|
|
48
48
|
validates :cost_price
|
49
49
|
validates :price
|
50
50
|
end
|
51
|
-
validates :sku, uniqueness: { conditions: -> { where(deleted_at: nil) } }, allow_blank: true
|
51
|
+
validates :sku, uniqueness: { conditions: -> { where(deleted_at: nil) }, case_sensitive: false }, allow_blank: true
|
52
52
|
|
53
53
|
after_create :create_stock_items
|
54
54
|
after_create :set_master_out_of_stock, unless: :is_master?
|
@@ -92,7 +92,6 @@ module Spree
|
|
92
92
|
not_discontinued.not_deleted.
|
93
93
|
for_currency_and_available_price_amount(currency)
|
94
94
|
end
|
95
|
-
|
96
95
|
LOCALIZED_NUMBERS = %w(cost_price weight depth width height)
|
97
96
|
|
98
97
|
LOCALIZED_NUMBERS.each do |m|
|
data/lib/spree/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.
|
4
|
+
version: 4.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|