solidus_core 2.11.13 → 2.11.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/spree/active_storage_adapter/attachment.rb +4 -2
- data/app/models/spree/address.rb +1 -0
- data/app/models/spree/order.rb +2 -2
- data/app/models/spree/order_shipping.rb +6 -9
- data/app/models/spree/product.rb +1 -0
- data/app/models/spree/promotion_code.rb +2 -2
- data/app/models/spree/refund.rb +8 -0
- data/app/models/spree/store_credit.rb +8 -0
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/testing_support/dummy_app.rb +1 -0
- data/solidus_core.gemspec +1 -1
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eca3c22f4ee132c33aece457789669a65671005ce5b1c985a142813b699e35b0
|
4
|
+
data.tar.gz: d049f348d8cea36cb7b94a842a44a8ac818e09aa8db7bd1893f97a6217bb8459
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96235dffd078546e6319b38e7f582d316a009bcacf45103a8962bb6d7a7e2402bc3c867e5ad29006a461267be4bab536704a8ae2527a0f996a314c2514a01632
|
7
|
+
data.tar.gz: 4955b7cc26bfa9ca9e33023fbba57dc58b91c149971d8676fcc3779bb3852bfcd8ae3daa26091072419bda8a2ad5e16121974edca644ff7385a96f045c6785a4
|
@@ -30,7 +30,9 @@ module Spree
|
|
30
30
|
size = style_to_size(style)
|
31
31
|
@attachment.variant(
|
32
32
|
resize_to_limit: size,
|
33
|
-
|
33
|
+
saver: {
|
34
|
+
strip: true
|
35
|
+
}
|
34
36
|
).processed
|
35
37
|
end
|
36
38
|
|
@@ -58,7 +60,7 @@ module Spree
|
|
58
60
|
end
|
59
61
|
|
60
62
|
def normalize_styles(styles)
|
61
|
-
styles.transform_values { |v| v.split('x') }
|
63
|
+
styles.transform_values { |v| v.split('x').map(&:to_i) }
|
62
64
|
end
|
63
65
|
|
64
66
|
def style_to_size(style)
|
data/app/models/spree/address.rb
CHANGED
@@ -84,6 +84,7 @@ module Spree
|
|
84
84
|
# @return [Hash] hash of attributes contributing to value equality with optional merge
|
85
85
|
def self.value_attributes(base_attributes, merge_attributes = {})
|
86
86
|
base = base_attributes.stringify_keys.merge(merge_attributes.stringify_keys)
|
87
|
+
base.delete("name") unless Spree::Config.use_combined_first_and_last_name_in_address
|
87
88
|
|
88
89
|
name_from_attributes = Spree::Address::Name.from_attributes(base)
|
89
90
|
if base['firstname'].presence || base['first_name'].presence
|
data/app/models/spree/order.rb
CHANGED
@@ -476,8 +476,8 @@ module Spree
|
|
476
476
|
"Spree::MailerSubscriber#order_finalized.",
|
477
477
|
caller(1)
|
478
478
|
|
479
|
-
Spree::Config.order_mailer_class.confirm_email(
|
480
|
-
|
479
|
+
Spree::Config.order_mailer_class.confirm_email(self).deliver_later
|
480
|
+
update_column(:confirmation_delivered, true)
|
481
481
|
end
|
482
482
|
|
483
483
|
# Helper methods for checkout steps
|
@@ -62,18 +62,15 @@ class Spree::OrderShipping
|
|
62
62
|
end
|
63
63
|
|
64
64
|
inventory_units.map(&:shipment).uniq.each do |shipment|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
# TODO: make OrderShipping#ship_shipment call Shipment#ship! rather than
|
71
|
-
# having Shipment#ship! call OrderShipping#ship_shipment. We only really
|
72
|
-
# need this `update_columns` for the specs, until we make that change.
|
73
|
-
shipment.update_columns(state: 'shipped', shipped_at: Time.current)
|
65
|
+
if shipment.inventory_units.reload.all? { |iu| iu.shipped? || iu.canceled? }
|
66
|
+
shipment.update!(state: "shipped", shipped_at: Time.current, tracking: tracking_number)
|
67
|
+
else
|
68
|
+
shipment.update!(tracking: tracking_number)
|
69
|
+
end
|
74
70
|
end
|
75
71
|
|
76
72
|
send_shipment_emails(carton) if stock_location.fulfillable? && !suppress_mailer # e.g. digital gift cards that aren't actually shipped
|
73
|
+
@order.shipments.reload
|
77
74
|
@order.recalculate
|
78
75
|
|
79
76
|
carton
|
data/app/models/spree/product.rb
CHANGED
@@ -5,12 +5,12 @@ class Spree::PromotionCode < Spree::Base
|
|
5
5
|
belongs_to :promotion_code_batch, class_name: "Spree::PromotionCodeBatch", optional: true
|
6
6
|
has_many :adjustments
|
7
7
|
|
8
|
+
before_validation :normalize_code
|
9
|
+
|
8
10
|
validates :value, presence: true, uniqueness: { allow_blank: true, case_sensitive: true }
|
9
11
|
validates :promotion, presence: true
|
10
12
|
validate :promotion_not_apply_automatically, on: :create
|
11
13
|
|
12
|
-
before_save :normalize_code
|
13
|
-
|
14
14
|
self.whitelisted_ransackable_attributes = ['value']
|
15
15
|
|
16
16
|
# Whether the promotion code has exceeded its usage restrictions
|
data/app/models/spree/refund.rb
CHANGED
@@ -36,6 +36,14 @@ module Spree
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
# Sets this price's amount to a new value, parsing it if the new value is
|
40
|
+
# a string.
|
41
|
+
#
|
42
|
+
# @param price [String, #to_d] a new amount
|
43
|
+
def amount=(price)
|
44
|
+
self[:amount] = Spree::LocalizedNumber.parse(price)
|
45
|
+
end
|
46
|
+
|
39
47
|
def description
|
40
48
|
payment.payment_method.name
|
41
49
|
end
|
@@ -40,6 +40,14 @@ class Spree::StoreCredit < Spree::PaymentSource
|
|
40
40
|
extend Spree::DisplayMoney
|
41
41
|
money_methods :amount, :amount_used, :amount_authorized
|
42
42
|
|
43
|
+
# Sets this store credit's amount to a new value,
|
44
|
+
# parsing it as a localized number if the new value is a string.
|
45
|
+
#
|
46
|
+
# @param number [String, #to_d] a new amount
|
47
|
+
def amount=(number)
|
48
|
+
self[:amount] = Spree::LocalizedNumber.parse(number)
|
49
|
+
end
|
50
|
+
|
43
51
|
def amount_remaining
|
44
52
|
return 0.0.to_d if invalidated?
|
45
53
|
amount - amount_used - amount_authorized
|
data/lib/spree/core/version.rb
CHANGED
data/solidus_core.gemspec
CHANGED
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
s.add_dependency 'kaminari-activerecord', '~> 1.1'
|
40
40
|
s.add_dependency 'mini_magick', '~> 4.10'
|
41
41
|
s.add_dependency 'monetize', '~> 1.8'
|
42
|
-
s.add_dependency 'paperclip', '>= 4.
|
42
|
+
s.add_dependency 'kt-paperclip', ['>= 4.4.0', '< 7']
|
43
43
|
s.add_dependency 'paranoia', '~> 2.4'
|
44
44
|
s.add_dependency 'ransack', '~> 2.0'
|
45
45
|
s.add_dependency 'state_machines-activerecord', '~> 0.6'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.
|
4
|
+
version: 2.11.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionmailer
|
@@ -331,19 +331,25 @@ dependencies:
|
|
331
331
|
- !ruby/object:Gem::Version
|
332
332
|
version: '1.8'
|
333
333
|
- !ruby/object:Gem::Dependency
|
334
|
-
name: paperclip
|
334
|
+
name: kt-paperclip
|
335
335
|
requirement: !ruby/object:Gem::Requirement
|
336
336
|
requirements:
|
337
337
|
- - ">="
|
338
338
|
- !ruby/object:Gem::Version
|
339
|
-
version:
|
339
|
+
version: 4.4.0
|
340
|
+
- - "<"
|
341
|
+
- !ruby/object:Gem::Version
|
342
|
+
version: '7'
|
340
343
|
type: :runtime
|
341
344
|
prerelease: false
|
342
345
|
version_requirements: !ruby/object:Gem::Requirement
|
343
346
|
requirements:
|
344
347
|
- - ">="
|
345
348
|
- !ruby/object:Gem::Version
|
346
|
-
version:
|
349
|
+
version: 4.4.0
|
350
|
+
- - "<"
|
351
|
+
- !ruby/object:Gem::Version
|
352
|
+
version: '7'
|
347
353
|
- !ruby/object:Gem::Dependency
|
348
354
|
name: paranoia
|
349
355
|
requirement: !ruby/object:Gem::Requirement
|
@@ -986,7 +992,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
986
992
|
- !ruby/object:Gem::Version
|
987
993
|
version: 1.8.23
|
988
994
|
requirements: []
|
989
|
-
rubygems_version: 3.
|
995
|
+
rubygems_version: 3.2.31
|
990
996
|
signing_key:
|
991
997
|
specification_version: 4
|
992
998
|
summary: Essential models, mailers, and classes for the Solidus e-commerce project.
|