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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c51ec975ec9a598a8c62ab1921bb8fd36205632e56145bca20b986f3ff89f07d
4
- data.tar.gz: 81302c9de608750a7452ad64b380a4b0a1932ba4b477a26e828c5937fc39988f
3
+ metadata.gz: eca3c22f4ee132c33aece457789669a65671005ce5b1c985a142813b699e35b0
4
+ data.tar.gz: d049f348d8cea36cb7b94a842a44a8ac818e09aa8db7bd1893f97a6217bb8459
5
5
  SHA512:
6
- metadata.gz: df514483ac9eb9d69d4063962bac359715920135901a6646be17e06f6303b1683475f46a2e4c5a4a1f66d5349720b3543dd0990ee986a1670fcfeb2e17496253
7
- data.tar.gz: 6d1162cfaa6bedd3a748f3ea729d7134f98be6e75117312bf206748fba31120e5888023b1954f7c65f7a5b51422316b317afc483dcff0c37a4c1790648f1a111
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
- strip: true
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)
@@ -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
@@ -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(order).deliver_later
480
- order.update_column(:confirmation_delivered, true)
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
- # Temporarily propagate the tracking number to the shipment as well
66
- # TODO: Remove tracking numbers from shipments.
67
- shipment.update!(tracking: tracking_number)
68
-
69
- next unless shipment.inventory_units.reload.all? { |iu| iu.shipped? || iu.canceled? }
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
@@ -49,6 +49,7 @@ module Spree
49
49
 
50
50
  has_many :variants,
51
51
  -> { where(is_master: false).order(:position) },
52
+ inverse_of: :product,
52
53
  class_name: 'Spree::Variant'
53
54
 
54
55
  has_many :variants_including_master,
@@ -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
@@ -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
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spree
4
- VERSION = "2.11.13"
4
+ VERSION = "2.11.16"
5
5
 
6
6
  def self.solidus_version
7
7
  VERSION
@@ -77,6 +77,7 @@ module DummyApp
77
77
  }
78
78
  }
79
79
  config.active_storage.service = :test
80
+ config.active_storage.variant_processor = ENV.fetch('ACTIVE_STORAGE_VARIANT_PROCESSOR', :mini_magick).to_sym
80
81
  end
81
82
  end
82
83
 
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.2'
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.13
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: 2021-12-07 00:00:00.000000000 Z
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: '4.2'
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: '4.2'
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.1.2
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.