comee_core 0.2.54 → 0.2.55
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/comee/core/application_controller.rb +10 -9
- data/app/controllers/comee/core/customer_order_items_controller.rb +2 -2
- data/app/controllers/comee/core/customer_orders_controller.rb +3 -3
- data/app/controllers/comee/core/sales_order_items_controller.rb +1 -1
- data/app/controllers/comee/core/sales_orders_controller.rb +4 -4
- data/app/controllers/comee/core/shipment_items_controller.rb +2 -2
- data/app/controllers/concerns/comee/core/common.rb +4 -4
- data/lib/comee/core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 153d3be4849a2a61ea05ee49995fdaf2c246263a2c579e9f9754f199fa4eb591
|
4
|
+
data.tar.gz: 988d4d60cc82d4f0d31331105f593457bd64f78f169d1d9ed0c8964eca4e358e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b14faed0811d25bdf08880f30bc753295b7250c1c1d7aaabc529de8c5387484d8c28e2c79dc5449b8c50925ca8bacdaff0c34b925180ae7df2bf69e3900ef59
|
7
|
+
data.tar.gz: 7845a9cddf77861a89b3b7fc4dd50e7449fc768d0cc6b6a92bf3675360bde9b4041a203219d4a18f227a2e44e1b6990f05c1d4ed078b70a81cfe162474d41a1b
|
@@ -13,15 +13,16 @@ module Comee
|
|
13
13
|
result[:page] = params[:page].to_i
|
14
14
|
result[:total] = total
|
15
15
|
end
|
16
|
-
result[:data] = if options.key?(:fields) && options.key?(:serializer)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
16
|
+
# result[:data] = if options.key?(:fields) && options.key?(:serializer)
|
17
|
+
# serialize(data, {include: options[:fields], serializer: options[:serializer]})
|
18
|
+
# elsif options.key?(:fields) && options.key?(:each_serializer)
|
19
|
+
# serialize(data, {include: options[:fields], each_serializer: options[:each_serializer]})
|
20
|
+
# elsif options.key?(:fields)
|
21
|
+
# serialize(data, {include: options[:fields]})
|
22
|
+
# else
|
23
|
+
# serialize(data)
|
24
|
+
# end
|
25
|
+
result[:data] = serialize(data, options)
|
25
26
|
render json: result
|
26
27
|
end
|
27
28
|
|
@@ -7,7 +7,7 @@ module Comee
|
|
7
7
|
super do
|
8
8
|
[
|
9
9
|
CustomerOrderItem.includes(:product, :unit).all,
|
10
|
-
|
10
|
+
include: ["unit"]
|
11
11
|
]
|
12
12
|
end
|
13
13
|
end
|
@@ -19,7 +19,7 @@ module Comee
|
|
19
19
|
|
20
20
|
def filter
|
21
21
|
data = CustomerOrderItem.includes(:product, :unit).ransack(params[:q]).result
|
22
|
-
render_content(data, {
|
22
|
+
render_content(data, {include: ["unit"]})
|
23
23
|
end
|
24
24
|
|
25
25
|
def destroy
|
@@ -9,7 +9,7 @@ module Comee
|
|
9
9
|
super do
|
10
10
|
[
|
11
11
|
CustomerOrder.includes(:client, customer_order_items: :unit).order(:created_at),
|
12
|
-
|
12
|
+
include: ["client", "customer_order_items.unit"]
|
13
13
|
]
|
14
14
|
end
|
15
15
|
end
|
@@ -18,7 +18,7 @@ module Comee
|
|
18
18
|
super do
|
19
19
|
[
|
20
20
|
CustomerOrder.includes(:client, customer_order_items: :unit).find(params[:id]),
|
21
|
-
|
21
|
+
include: ["client", "customer_order_items.unit"]
|
22
22
|
]
|
23
23
|
end
|
24
24
|
end
|
@@ -58,7 +58,7 @@ module Comee
|
|
58
58
|
|
59
59
|
def filter
|
60
60
|
orders = CustomerOrder.includes(:client, :customer_order_items).ransack(params[:q]).result
|
61
|
-
render_content(orders,
|
61
|
+
render_content(orders, include: ["client", "customer_order_items.unit"])
|
62
62
|
end
|
63
63
|
|
64
64
|
private
|
@@ -21,7 +21,7 @@ module Comee
|
|
21
21
|
render_content(
|
22
22
|
details,
|
23
23
|
{
|
24
|
-
|
24
|
+
include: ["shipment_items.item_statuses", "purchase_order_item.purchase_order"],
|
25
25
|
serializer: SalesOrderItemDetailSerializer
|
26
26
|
}
|
27
27
|
)
|
@@ -14,7 +14,7 @@ module Comee
|
|
14
14
|
).order(created_at: :desc)
|
15
15
|
[
|
16
16
|
data,
|
17
|
-
|
17
|
+
include: [
|
18
18
|
"client",
|
19
19
|
"customer_order",
|
20
20
|
"sales_order_items",
|
@@ -30,7 +30,7 @@ module Comee
|
|
30
30
|
super do
|
31
31
|
[
|
32
32
|
SalesOrder.includes(:customer_order, :client, :customs_detail, sales_order_items: :unit).find(params[:id]),
|
33
|
-
|
33
|
+
include: [
|
34
34
|
"client",
|
35
35
|
"customer_order",
|
36
36
|
"sales_order_items",
|
@@ -44,7 +44,7 @@ module Comee
|
|
44
44
|
|
45
45
|
def update
|
46
46
|
super do
|
47
|
-
{
|
47
|
+
{include: ["client", "customer_order", "sales_order_items", "sales_order_items.product", "sales_order_items.unit"]}
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
@@ -57,7 +57,7 @@ module Comee
|
|
57
57
|
).ransack(params[:q]).result
|
58
58
|
render_content(
|
59
59
|
data,
|
60
|
-
|
60
|
+
include: ["client", "customer_order", "sales_order_items.product", "sales_order_items.unit", "customs_detail"]
|
61
61
|
)
|
62
62
|
end
|
63
63
|
|
@@ -7,14 +7,14 @@ module Comee
|
|
7
7
|
super do
|
8
8
|
[
|
9
9
|
ShipmentItem.includes(sales_order_item: [sales_order: :client]).all,
|
10
|
-
|
10
|
+
include: ["sales_order_item.sales_order.client"]
|
11
11
|
]
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def filter
|
16
16
|
shipment_item = ShipmentItem.includes(:sales_order_item).ransack(params[:q]).result
|
17
|
-
options = {
|
17
|
+
options = {include: ["sales_order_item.sales_order.client", "sales_order_item.product", "sales_order_item.unit"]}
|
18
18
|
render_content(shipment_item, options)
|
19
19
|
end
|
20
20
|
|
@@ -28,7 +28,7 @@ module Comee
|
|
28
28
|
data = data.then(&paginate) if params[:page]
|
29
29
|
result = {
|
30
30
|
success: true,
|
31
|
-
data:
|
31
|
+
data: serialize(data, options)
|
32
32
|
}
|
33
33
|
if params[:page]
|
34
34
|
result[:page] = params[:page]
|
@@ -56,7 +56,7 @@ module Comee
|
|
56
56
|
end
|
57
57
|
result = {
|
58
58
|
success: true,
|
59
|
-
data:
|
59
|
+
data: serialize(data, options)
|
60
60
|
}
|
61
61
|
render json: result
|
62
62
|
end
|
@@ -81,7 +81,7 @@ module Comee
|
|
81
81
|
if obj.save
|
82
82
|
result = {
|
83
83
|
success: true,
|
84
|
-
data:
|
84
|
+
data: serialize(obj, options)
|
85
85
|
}
|
86
86
|
render json: result, status: :created
|
87
87
|
else
|
@@ -111,7 +111,7 @@ module Comee
|
|
111
111
|
if obj.update(model_params)
|
112
112
|
result = {
|
113
113
|
success: true,
|
114
|
-
data:
|
114
|
+
data: serialize(obj, options)
|
115
115
|
}
|
116
116
|
render json: result
|
117
117
|
else
|
data/lib/comee/core/version.rb
CHANGED