effective_orders 6.16.4 → 6.17.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1694915aa5c646859677437bf8eef6227c2301dd850928cb4d7c179fcf74a17a
|
4
|
+
data.tar.gz: 702d26261725a04e5ef44ae247aa98719204f2090d99f0e7326ec91422f792a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eace5c4d6ab80404524a861323b58dff8e7f84af4714ec3001eb29724faf545dda03312a5c92b362364512e93113051c601428455a43689be8912d0318192a96
|
7
|
+
data.tar.gz: c63d78cc2e5e97c66f4995124753722bcd55ba7ed7edc2b28ccf58bf62dc710ad02298339fc8935fc115284efabffda2ac5280ee971ed5d8b88054a134b90ddf
|
@@ -49,14 +49,47 @@ module ActsAsPurchasable
|
|
49
49
|
validates_with Effective::SoldOutValidator, on: :create
|
50
50
|
end
|
51
51
|
|
52
|
-
scope :purchased, -> {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
52
|
+
scope :purchased, -> {
|
53
|
+
if respond_to?(:unarchived)
|
54
|
+
unarchived.where.not(purchased_order_id: nil)
|
55
|
+
else
|
56
|
+
where.not(purchased_order_id: nil)
|
57
|
+
end
|
58
|
+
}
|
59
|
+
|
60
|
+
scope :not_purchased, -> {
|
61
|
+
if respond_to?(:unarchived)
|
62
|
+
unarchived.where(purchased_order_id: nil)
|
63
|
+
else
|
64
|
+
where(purchased_order_id: nil)
|
65
|
+
end
|
66
|
+
}
|
67
|
+
|
68
|
+
scope :purchased_or_deferred, -> {
|
69
|
+
if respond_to?(:unarchived)
|
70
|
+
unarchived.joins(order_items: :order).where(orders: { status: [:purchased, :deferred] })
|
71
|
+
else
|
72
|
+
joins(order_items: :order).where(orders: { status: [:purchased, :deferred] })
|
73
|
+
end
|
74
|
+
}
|
75
|
+
|
76
|
+
scope :deferred, -> {
|
77
|
+
if respond_to?(:unarchived)
|
78
|
+
unarchived.joins(order_items: :order).where(orders: { status: :deferred })
|
79
|
+
else
|
80
|
+
joins(order_items: :order).where(orders: { status: :deferred })
|
81
|
+
end
|
82
|
+
}
|
83
|
+
|
84
|
+
scope :purchased_by, -> (user) {
|
85
|
+
if respond_to?(:unarchived)
|
86
|
+
unarchived.joins(order_items: :order).where(orders: { purchased_by: user, status: :purchased }).distinct
|
87
|
+
else
|
88
|
+
joins(order_items: :order).where(orders: { purchased_by: user, status: :purchased }).distinct
|
89
|
+
end
|
90
|
+
}
|
91
|
+
|
92
|
+
scope :not_purchased_by, -> (user) { where.not(id: purchased_by(user)) }
|
60
93
|
end
|
61
94
|
|
62
95
|
module ClassMethods
|
@@ -4,7 +4,7 @@
|
|
4
4
|
= link_to 'Change Addresses', effective_orders.edit_order_path(order), rel: :nofollow
|
5
5
|
|
6
6
|
- unless local_assigns[:skip_order]
|
7
|
-
= render('/effective/orders/order', order: order
|
7
|
+
= render('/effective/orders/order', order: order)
|
8
8
|
|
9
9
|
.effective-order-purchase-actions
|
10
10
|
- provider_locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url }
|
@@ -10,7 +10,7 @@
|
|
10
10
|
- if order.delayed?
|
11
11
|
%p Your #{order.delayed_payment_method} will be charged on #{order.delayed_payment_date.strftime('%F')}
|
12
12
|
- else
|
13
|
-
%p Waiting for payment by #{order.payment_provider}
|
13
|
+
%p Waiting for payment by #{order.payment_provider}.
|
14
14
|
|
15
15
|
- if order.payment_provider == "etransfer" && (EffectiveOrders.etransfer[:success] rescue false).present?
|
16
16
|
%p= EffectiveOrders.etransfer[:success].html_safe
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_orders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|