spree_core 4.6.4 → 4.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/spree/address.rb +1 -1
  3. data/app/models/spree/asset.rb +1 -1
  4. data/app/models/spree/calculator/default_tax.rb +1 -1
  5. data/app/models/spree/cms_page.rb +1 -1
  6. data/app/models/spree/cms_section.rb +1 -1
  7. data/app/models/spree/credit_card.rb +1 -1
  8. data/app/models/spree/customer_return.rb +2 -2
  9. data/app/models/spree/line_item.rb +1 -1
  10. data/app/models/spree/option_type.rb +3 -3
  11. data/app/models/spree/option_value.rb +2 -2
  12. data/app/models/spree/order/store_credit.rb +8 -0
  13. data/app/models/spree/order.rb +3 -3
  14. data/app/models/spree/order_contents.rb +31 -0
  15. data/app/models/spree/payment.rb +3 -3
  16. data/app/models/spree/payment_method.rb +1 -1
  17. data/app/models/spree/payment_source.rb +1 -1
  18. data/app/models/spree/price.rb +1 -1
  19. data/app/models/spree/product.rb +7 -6
  20. data/app/models/spree/promotion.rb +2 -2
  21. data/app/models/spree/property.rb +2 -2
  22. data/app/models/spree/prototype.rb +1 -1
  23. data/app/models/spree/refund.rb +1 -1
  24. data/app/models/spree/reimbursement.rb +1 -1
  25. data/app/models/spree/return_authorization.rb +1 -1
  26. data/app/models/spree/shipment.rb +3 -3
  27. data/app/models/spree/shipping_method.rb +1 -1
  28. data/app/models/spree/stock/estimator.rb +1 -1
  29. data/app/models/spree/stock_item.rb +1 -1
  30. data/app/models/spree/stock_transfer.rb +3 -3
  31. data/app/models/spree/store_credit.rb +1 -1
  32. data/app/models/spree/taxon.rb +3 -3
  33. data/app/models/spree/taxonomy.rb +2 -2
  34. data/app/models/spree/variant.rb +2 -2
  35. data/lib/spree/core/version.rb +1 -1
  36. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1eaae4db080d34b28d92a5fe2d41eceb0bc99114a4be047b3320c7305c176306
4
- data.tar.gz: 9a8948040fda3a08c5f0fb5fd2d6519c4ea9b4fece7cc91131d2a2072f25c982
3
+ metadata.gz: fae2e48673736c835ed7a9d9b5fdf18a35df19ce09eb27a92c6b13376e62a46e
4
+ data.tar.gz: e48f60fe8dcbeaa67028bb4ce9e23baba71f33afb32ff04be86636c60c9ed378
5
5
  SHA512:
6
- metadata.gz: 2654308ff6eb25c99a661e2dfa6f4815d9b73bc0ef01c134a59aa2d1eaebcec16ee9f5c1e3fddbf207771e50a6b3a10f28ddf84b424adb5cdd2343360da8e63e
7
- data.tar.gz: 3bfce5acc6964b4a9b0f7dcf12e07918f61d27f57e4fcf69783bbab32c95747d81bc2a764ec1557e86d4238593ddcb0145500c801176c4a7f3bf7582b8f14ac6
6
+ metadata.gz: 706d673aa098f26442eafe06fd1b7eab7dd7267bb9514b3c6f2f1124eff2ea950c5d1dfdde5f8d1c7258c41c9fb5456e0655a2249fa91331267ebef397bf97c8
7
+ data.tar.gz: 2bb5c0f817b50bdafd1a83708bf6f85cf0b9d69ca605bb48c936d7225fdf3fcf036a0f44e5e901ed9365bf17fc6b826f5190af5841d0e5eb6c1b5ce02e1e49c2
@@ -2,7 +2,7 @@ module Spree
2
2
  class Address < Spree::Base
3
3
  require 'validates_zipcode'
4
4
 
5
- include Metadata
5
+ include Spree::Metadata
6
6
  if defined?(Spree::Webhooks)
7
7
  include Spree::Webhooks::HasWebhooks
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  class Asset < Spree::Base
3
3
  include Support::ActiveStorage
4
- include Metadata
4
+ include Spree::Metadata
5
5
  if defined?(Spree::Webhooks)
6
6
  include Spree::Webhooks::HasWebhooks
7
7
  end
@@ -2,7 +2,7 @@ require_dependency 'spree/calculator'
2
2
 
3
3
  module Spree
4
4
  class Calculator::DefaultTax < Calculator
5
- include VatPriceCalculation
5
+ include Spree::VatPriceCalculation
6
6
  def self.description
7
7
  Spree.t(:default_tax)
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  class CmsPage < Base
3
3
  include SingleStoreResource
4
- include DisplayLink
4
+ include Spree::DisplayLink
5
5
 
6
6
  if defined?(Spree::Webhooks)
7
7
  include Spree::Webhooks::HasWebhooks
@@ -1,6 +1,6 @@
1
1
  module Spree
2
2
  class CmsSection < Base
3
- include DisplayLink
3
+ include Spree::DisplayLink
4
4
 
5
5
  acts_as_list scope: :cms_page
6
6
  belongs_to :cms_page, touch: true
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  class CreditCard < Spree::Base
3
3
  include ActiveMerchant::Billing::CreditCardMethods
4
- include Metadata
4
+ include Spree::Metadata
5
5
  if defined?(Spree::Webhooks)
6
6
  include Spree::Webhooks::HasWebhooks
7
7
  end
@@ -1,8 +1,8 @@
1
1
  module Spree
2
2
  class CustomerReturn < Spree::Base
3
3
  include Spree::Core::NumberGenerator.new(prefix: 'CR', length: 9)
4
- include NumberIdentifier
5
- include Metadata
4
+ include Spree::NumberIdentifier
5
+ include Spree::Metadata
6
6
  if defined?(Spree::Webhooks)
7
7
  include Spree::Webhooks::HasWebhooks
8
8
  end
@@ -1,6 +1,6 @@
1
1
  module Spree
2
2
  class LineItem < Spree::Base
3
- include Metadata
3
+ include Spree::Metadata
4
4
  if defined?(Spree::Webhooks)
5
5
  include Spree::Webhooks::HasWebhooks
6
6
  end
@@ -1,8 +1,8 @@
1
1
  module Spree
2
2
  class OptionType < Spree::Base
3
- include UniqueName
4
- include Metadata
5
- include TranslatableResource
3
+ include Spree::UniqueName
4
+ include Spree::Metadata
5
+ include Spree::TranslatableResource
6
6
  if defined?(Spree::Webhooks)
7
7
  include Spree::Webhooks::HasWebhooks
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  class OptionValue < Spree::Base
3
- include Metadata
4
- include TranslatableResource
3
+ include Spree::Metadata
4
+ include Spree::TranslatableResource
5
5
  if defined?(Spree::Webhooks)
6
6
  include Spree::Webhooks::HasWebhooks
7
7
  end
@@ -1,6 +1,14 @@
1
1
  module Spree
2
2
  class Order < Spree::Base
3
3
  module StoreCredit
4
+ def add_store_credit_payments(amount = nil)
5
+ Spree::Dependencies.checkout_add_store_credit_service.constantize.call(order: self, amount: amount)
6
+ end
7
+
8
+ def remove_store_credit_payments
9
+ Spree::Dependencies.checkout_remove_store_credit_service.constantize.call(order: self)
10
+ end
11
+
4
12
  def covered_by_store_credit?
5
13
  return false unless user
6
14
 
@@ -20,10 +20,10 @@ module Spree
20
20
  include Spree::Core::NumberGenerator.new(prefix: 'R')
21
21
  include Spree::Core::TokenGenerator
22
22
 
23
- include NumberIdentifier
24
- include NumberAsParam
23
+ include Spree::NumberIdentifier
24
+ include Spree::NumberAsParam
25
25
  include SingleStoreResource
26
- include MemoizedData
26
+ include Spree::MemoizedData
27
27
  include Spree::Metadata
28
28
  if defined?(Spree::Webhooks)
29
29
  include Spree::Webhooks::HasWebhooks
@@ -0,0 +1,31 @@
1
+ module Spree
2
+ class OrderContents
3
+ attr_accessor :order, :currency
4
+
5
+ def initialize(order)
6
+ @order = order
7
+ end
8
+
9
+ def add(variant, quantity = 1, options = {})
10
+ Spree::Dependencies.cart_add_item_service.constantize.call(order: order,
11
+ variant: variant,
12
+ quantity: quantity,
13
+ options: options).value
14
+ end
15
+
16
+ def remove(variant, quantity = 1, options = {})
17
+ Spree::Dependencies.cart_remove_item_service.constantize.call(order: order,
18
+ variant: variant,
19
+ quantity: quantity,
20
+ options: options).value
21
+ end
22
+
23
+ def remove_line_item(line_item, options = {})
24
+ Spree::Cart::RemoveLineItem.call(order: @order, line_item: line_item, options: options).value
25
+ end
26
+
27
+ def update_cart(params)
28
+ Spree::Dependencies.cart_update_service.constantize.call(order: order, params: params).value
29
+ end
30
+ end
31
+ end
@@ -3,9 +3,9 @@ require_dependency 'spree/payment/processing'
3
3
  module Spree
4
4
  class Payment < Spree::Base
5
5
  include Spree::Core::NumberGenerator.new(prefix: 'P', letters: true, length: 7)
6
- include NumberIdentifier
7
- include NumberAsParam
8
- include Metadata
6
+ include Spree::NumberIdentifier
7
+ include Spree::NumberAsParam
8
+ include Spree::Metadata
9
9
  if defined?(Spree::Webhooks)
10
10
  include Spree::Webhooks::HasWebhooks
11
11
  end
@@ -3,7 +3,7 @@ module Spree
3
3
  acts_as_paranoid
4
4
  acts_as_list
5
5
 
6
- include MultiStoreResource
6
+ include Spree::MultiStoreResource
7
7
  include Spree::Metadata
8
8
  if defined?(Spree::Security::PaymentMethods)
9
9
  include Spree::Security::PaymentMethods
@@ -1,6 +1,6 @@
1
1
  module Spree
2
2
  class PaymentSource < Spree::Base
3
- include Metadata
3
+ include Spree::Metadata
4
4
 
5
5
  belongs_to :payment_method, class_name: 'Spree::PaymentMethod'
6
6
  belongs_to :user, class_name: 'Spree::User', optional: true
@@ -1,6 +1,6 @@
1
1
  module Spree
2
2
  class Price < Spree::Base
3
- include VatPriceCalculation
3
+ include Spree::VatPriceCalculation
4
4
  if defined?(Spree::Webhooks)
5
5
  include Spree::Webhooks::HasWebhooks
6
6
  end
@@ -21,12 +21,13 @@
21
21
  module Spree
22
22
  class Product < Spree::Base
23
23
  extend FriendlyId
24
- include ProductScopes
25
- include MultiStoreResource
26
- include TranslatableResource
27
- include TranslatableResourceSlug
28
- include MemoizedData
29
- include Metadata
24
+ include Spree::ProductScopes
25
+ include Spree::MultiStoreResource
26
+ include Spree::TranslatableResource
27
+ include Spree::TranslatableResourceSlug
28
+ include Spree::MemoizedData
29
+ include Spree::Metadata
30
+
30
31
  if defined?(Spree::Webhooks)
31
32
  include Spree::Webhooks::HasWebhooks
32
33
  end
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  class Promotion < Spree::Base
3
- include MultiStoreResource
4
- include Metadata
3
+ include Spree::MultiStoreResource
4
+ include Spree::Metadata
5
5
  if defined?(Spree::Webhooks)
6
6
  include Spree::Webhooks::HasWebhooks
7
7
  end
@@ -1,8 +1,8 @@
1
1
  module Spree
2
2
  class Property < Spree::Base
3
3
  include Spree::FilterParam
4
- include Metadata
5
- include TranslatableResource
4
+ include Spree::Metadata
5
+ include Spree::TranslatableResource
6
6
  if defined?(Spree::Webhooks)
7
7
  include Spree::Webhooks::HasWebhooks
8
8
  end
@@ -1,6 +1,6 @@
1
1
  module Spree
2
2
  class Prototype < Spree::Base
3
- include Metadata
3
+ include Spree::Metadata
4
4
  if defined?(Spree::Webhooks)
5
5
  include Spree::Webhooks::HasWebhooks
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Spree
2
2
  class Refund < Spree::Base
3
- include Metadata
3
+ include Spree::Metadata
4
4
  if defined?(Spree::Webhooks)
5
5
  include Spree::Webhooks::HasWebhooks
6
6
  end
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  class Reimbursement < Spree::Base
3
3
  include Spree::Core::NumberGenerator.new(prefix: 'RI', length: 9)
4
- include NumberIdentifier
4
+ include Spree::NumberIdentifier
5
5
  if defined?(Spree::Webhooks)
6
6
  include Spree::Webhooks::HasWebhooks
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  class ReturnAuthorization < Spree::Base
3
3
  include Spree::Core::NumberGenerator.new(prefix: 'RA', length: 9)
4
- include NumberIdentifier
4
+ include Spree::NumberIdentifier
5
5
  if defined?(Spree::Webhooks)
6
6
  include Spree::Webhooks::HasWebhooks
7
7
  end
@@ -3,9 +3,9 @@ require 'ostruct'
3
3
  module Spree
4
4
  class Shipment < Spree::Base
5
5
  include Spree::Core::NumberGenerator.new(prefix: 'H', length: 11)
6
- include NumberIdentifier
7
- include NumberAsParam
8
- include Metadata
6
+ include Spree::NumberIdentifier
7
+ include Spree::NumberAsParam
8
+ include Spree::Metadata
9
9
  if defined?(Spree::Webhooks)
10
10
  include Spree::Webhooks::HasWebhooks
11
11
  end
@@ -2,7 +2,7 @@ module Spree
2
2
  class ShippingMethod < Spree::Base
3
3
  acts_as_paranoid
4
4
  include Spree::CalculatedAdjustments
5
- include Metadata
5
+ include Spree::Metadata
6
6
  if defined?(Spree::Webhooks)
7
7
  include Spree::Webhooks::HasWebhooks
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  module Stock
3
3
  class Estimator
4
- include VatPriceCalculation
4
+ include Spree::VatPriceCalculation
5
5
 
6
6
  attr_reader :order, :currency
7
7
 
@@ -2,7 +2,7 @@ module Spree
2
2
  class StockItem < Spree::Base
3
3
  acts_as_paranoid
4
4
 
5
- include Metadata
5
+ include Spree::Metadata
6
6
  if defined?(Spree::Webhooks)
7
7
  include Spree::Webhooks::HasWebhooks
8
8
  end
@@ -1,9 +1,9 @@
1
1
  module Spree
2
2
  class StockTransfer < Spree::Base
3
3
  include Spree::Core::NumberGenerator.new(prefix: 'T')
4
- include NumberIdentifier
5
- include NumberAsParam
6
- include Metadata
4
+ include Spree::NumberIdentifier
5
+ include Spree::NumberAsParam
6
+ include Spree::Metadata
7
7
  if defined?(Spree::Webhooks)
8
8
  include Spree::Webhooks::HasWebhooks
9
9
  end
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  class StoreCredit < Spree::Base
3
3
  include SingleStoreResource
4
- include Metadata
4
+ include Spree::Metadata
5
5
  if defined?(Spree::Webhooks)
6
6
  include Spree::Webhooks::HasWebhooks
7
7
  end
@@ -3,9 +3,9 @@ require 'stringex'
3
3
 
4
4
  module Spree
5
5
  class Taxon < Spree::Base
6
- include TranslatableResource
7
- include TranslatableResourceSlug
8
- include Metadata
6
+ include Spree::TranslatableResource
7
+ include Spree::TranslatableResourceSlug
8
+ include Spree::Metadata
9
9
  if defined?(Spree::Webhooks)
10
10
  include Spree::Webhooks::HasWebhooks
11
11
  end
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  class Taxonomy < Spree::Base
3
- include TranslatableResource
4
- include Metadata
3
+ include Spree::TranslatableResource
4
+ include Spree::Metadata
5
5
  if defined?(Spree::Webhooks)
6
6
  include Spree::Webhooks::HasWebhooks
7
7
  end
@@ -3,8 +3,8 @@ module Spree
3
3
  acts_as_paranoid
4
4
  acts_as_list scope: :product
5
5
 
6
- include MemoizedData
7
- include Metadata
6
+ include Spree::MemoizedData
7
+ include Spree::Metadata
8
8
  if defined?(Spree::Webhooks)
9
9
  include Spree::Webhooks::HasWebhooks
10
10
  end
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '4.6.4'.freeze
2
+ VERSION = '4.6.6'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.4
4
+ version: 4.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-01-09 00:00:00.000000000 Z
12
+ date: 2024-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -670,6 +670,7 @@ files:
670
670
  - app/models/spree/order/emails.rb
671
671
  - app/models/spree/order/payments.rb
672
672
  - app/models/spree/order/store_credit.rb
673
+ - app/models/spree/order_contents.rb
673
674
  - app/models/spree/order_inventory.rb
674
675
  - app/models/spree/order_merger.rb
675
676
  - app/models/spree/order_promotion.rb
@@ -1127,9 +1128,9 @@ licenses:
1127
1128
  - BSD-3-Clause
1128
1129
  metadata:
1129
1130
  bug_tracker_uri: https://github.com/spree/spree/issues
1130
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.6.4
1131
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.6.6
1131
1132
  documentation_uri: https://dev-docs.spreecommerce.org/
1132
- source_code_uri: https://github.com/spree/spree/tree/v4.6.4
1133
+ source_code_uri: https://github.com/spree/spree/tree/v4.6.6
1133
1134
  post_install_message:
1134
1135
  rdoc_options: []
1135
1136
  require_paths:
@@ -1145,7 +1146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1145
1146
  - !ruby/object:Gem::Version
1146
1147
  version: 1.8.23
1147
1148
  requirements: []
1148
- rubygems_version: 3.4.1
1149
+ rubygems_version: 3.5.3
1149
1150
  signing_key:
1150
1151
  specification_version: 4
1151
1152
  summary: The bare bones necessary for Spree