effective_orders 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/effective/datatables/orders.rb +9 -12
- data/lib/effective_orders/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: c1e228be4429904e02e51771125e189f2c917642
|
4
|
+
data.tar.gz: 60ca8ea9cb693199784c7bfaf6d1424fc6bd6412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89ab63b17901c6dd25e2f590f78d77427bde9dcaec50ff36d86760b57b1c24356ef7c4b3b6bf086dbb744b73e2e962a8f04fa8a8022d136a94a6921d9d9c31b1
|
7
|
+
data.tar.gz: f1714b29a9588dd1b78c034f74ad95305876713e5780def64c82bffe59153ed86a716d593f3853eb5bb0a325900b9b2e64a4efbcd3db8c95d24cc945208e596c
|
@@ -11,8 +11,8 @@ if defined?(EffectiveDatatables)
|
|
11
11
|
end
|
12
12
|
|
13
13
|
if EffectiveOrders.require_billing_address
|
14
|
-
table_column :
|
15
|
-
(order[:
|
14
|
+
table_column :buyer_name, :sortable => false, :label => 'Buyer Name', :if => Proc.new { attributes[:user_id].blank? } do |order|
|
15
|
+
(order[:buyer_name] || '').split('!!SEP!!').find { |name| name.present? }
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -33,12 +33,7 @@ if defined?(EffectiveDatatables)
|
|
33
33
|
end
|
34
34
|
|
35
35
|
table_column :actions, :sortable => false, :filter => false do |order|
|
36
|
-
|
37
|
-
[
|
38
|
-
link_to('View', (datatables_admin_path? ? effective_orders.admin_order_path(order) : effective_orders.order_path(order))),
|
39
|
-
(link_to('Resend Receipt', effective_orders.resend_buyer_receipt_path(order), {'data-confirm' => 'This action will resend a copy of the original email receipt. Send receipt now?'}) if order.try(:purchased?))
|
40
|
-
].compact.join(' - ').html_safe
|
41
|
-
end
|
36
|
+
link_to('View', (datatables_admin_path? ? effective_orders.admin_order_path(order) : effective_orders.order_path(order)))
|
42
37
|
end
|
43
38
|
|
44
39
|
def collection
|
@@ -52,11 +47,13 @@ if defined?(EffectiveDatatables)
|
|
52
47
|
.select("#{query_total} AS total")
|
53
48
|
.select("string_agg(order_items.title, '!!SEP!!') AS order_items")
|
54
49
|
|
55
|
-
if EffectiveOrders.require_billing_address
|
50
|
+
if EffectiveOrders.require_billing_address && defined?(EffectiveAddresses)
|
51
|
+
tblAddresses = EffectiveAddresses.addresses_table_name
|
52
|
+
|
56
53
|
collection = collection
|
57
|
-
.joins("LEFT
|
58
|
-
.
|
59
|
-
.
|
54
|
+
.joins("LEFT JOIN (SELECT addressable_id, string_agg(#{tblAddresses}.full_name, '!!SEP!!') AS buyer_name FROM #{tblAddresses} WHERE #{tblAddresses}.category = 'billing' AND #{tblAddresses}.addressable_type = 'Effective::Order' GROUP BY #{tblAddresses}.addressable_id) #{tblAddresses} ON orders.id = #{tblAddresses}.addressable_id")
|
55
|
+
.group("#{tblAddresses}.buyer_name")
|
56
|
+
.select("#{tblAddresses}.buyer_name AS buyer_name")
|
60
57
|
end
|
61
58
|
|
62
59
|
if attributes[:user_id].present?
|
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: 1.2.
|
4
|
+
version: 1.2.5
|
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:
|
11
|
+
date: 2015-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|