spree_core 3.4.2 → 3.4.3
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: b40b001a02d80dd28675476b606bad24d0b6ca37
|
4
|
+
data.tar.gz: ef12f4025bdf9dccc1f6c309fd8e10e60afddd4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0e5fe4e45e6f9a80ec20e7fdbd8a3f289b98de4a6b5f729c149e39796bfa04dfaaf8c9d98725e8754faa4a0eb6ad77090f5dd505d60a983aa12426e168f3cc7
|
7
|
+
data.tar.gz: 80a5b7eccac0e49e8cd5d287d8dff818a1965086476b6b2fb440a9c7bdc8a5d87f4c2f59d81d3500dc978cdaf74f350a0e7c01d4382af564122203515d4b62e4
|
data/app/models/spree/order.rb
CHANGED
@@ -620,6 +620,22 @@ module Spree
|
|
620
620
|
promotions.pluck(:code).compact.first
|
621
621
|
end
|
622
622
|
|
623
|
+
def payments_attributes=(attributes)
|
624
|
+
validate_payments_attributes(attributes)
|
625
|
+
super(attributes)
|
626
|
+
end
|
627
|
+
|
628
|
+
def validate_payments_attributes(attributes)
|
629
|
+
# Ensure the payment methods specified are allowed for this user
|
630
|
+
payment_methods = Spree::PaymentMethod.where(id: available_payment_methods.map(&:id))
|
631
|
+
attributes.each do |payment_attributes|
|
632
|
+
payment_method_id = payment_attributes[:payment_method_id]
|
633
|
+
|
634
|
+
# raise RecordNotFound unless it is an allowed payment method
|
635
|
+
payment_methods.find(payment_method_id) if payment_method_id
|
636
|
+
end
|
637
|
+
end
|
638
|
+
|
623
639
|
private
|
624
640
|
|
625
641
|
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.4.
|
4
|
+
version: 3.4.3
|
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
|