spree_core 3.2.6 → 3.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/spree/order.rb +16 -0
- data/lib/spree/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b966f0b41c17b1b0397491803b4f3f475f472375
|
4
|
+
data.tar.gz: bf70f58208a09a564a5b337b3a2b84cad71e27d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acbd6dd076a001da65ed6bb6340e5670ff6169884ebb44941eebed7659dbbadea45589e568d6d7e0660a88b2272f77a50bb8543a933496772ecceda61f95bb67
|
7
|
+
data.tar.gz: 32694d53a8ef20c28199bc571e9a8ebd3b5a153a69b7fa4e5c87522e6aa0e1c9a59724c03e663ce0935d9a5bdda09ba945b909032358ac614f19feeaaf7a2c2f
|
data/app/models/spree/order.rb
CHANGED
@@ -604,6 +604,22 @@ module Spree
|
|
604
604
|
end
|
605
605
|
alias_method :fully_discounted, :fully_discounted?
|
606
606
|
|
607
|
+
def payments_attributes=(attributes)
|
608
|
+
validate_payments_attributes(attributes)
|
609
|
+
super(attributes)
|
610
|
+
end
|
611
|
+
|
612
|
+
def validate_payments_attributes(attributes)
|
613
|
+
# Ensure the payment methods specified are allowed for this user
|
614
|
+
payment_methods = Spree::PaymentMethod.where(id: available_payment_methods.map(&:id))
|
615
|
+
attributes.each do |payment_attributes|
|
616
|
+
payment_method_id = payment_attributes[:payment_method_id]
|
617
|
+
|
618
|
+
# raise RecordNotFound unless it is an allowed payment method
|
619
|
+
payment_methods.find(payment_method_id) if payment_method_id
|
620
|
+
end
|
621
|
+
end
|
622
|
+
|
607
623
|
private
|
608
624
|
|
609
625
|
def link_by_email
|
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: 3.2.
|
4
|
+
version: 3.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|