erp_integration 0.53.0 → 0.53.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/erp_integration/fulfil/api_resource.rb +24 -18
- data/lib/erp_integration/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: 94641315e041baf5dfa5ade8f7d4802f53bf70cff09f3fadd61b2232f2b541ca
|
4
|
+
data.tar.gz: b32375c29eed88ee070426ea42465d36cb8c8dd309512a41cf54649fc956940d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e87ddefd4bc53228dd37ba8f6e1651d9f160401898f44f9d16b740b3e78d5aab6f1e2cc415b6ab31066393e7ac8babf272c17107bc7b113005f67ec5c8395c2
|
7
|
+
data.tar.gz: 9c0f725849676df52f149df431367079cb9652afcb07ad55b295433e96124f251a292e91f98df08d70f9fe986b1da25b1a8e497d6ccfddb2a04bd8529fd801b4
|
@@ -72,16 +72,19 @@ module ErpIntegration
|
|
72
72
|
# be executed and the results will be fetched.
|
73
73
|
# @return [Array] An enumerable collection object with all API results.
|
74
74
|
def all
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
75
|
+
return @results if defined?(@results)
|
76
|
+
|
77
|
+
@results =
|
78
|
+
client.put(
|
79
|
+
api_resource_path,
|
80
|
+
Query.new(
|
81
|
+
fields: selected_fields,
|
82
|
+
filters: where_clauses,
|
83
|
+
alternative_filters: or_clauses,
|
84
|
+
limit: limit_value,
|
85
|
+
offset: calculated_offset
|
86
|
+
)
|
87
|
+
).map { |item| resource_klass.new(item) }
|
85
88
|
end
|
86
89
|
|
87
90
|
# As with the `all` method, the `query methods` lazyly build a search/read
|
@@ -90,14 +93,17 @@ module ErpIntegration
|
|
90
93
|
# the result will be fetched
|
91
94
|
# @return [Integer] The count of records that match with the query in Fulfil
|
92
95
|
def count
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
96
|
+
return @count if defined?(@count)
|
97
|
+
|
98
|
+
@count =
|
99
|
+
client.put(
|
100
|
+
"model/#{model_name}/search_count",
|
101
|
+
Query.new(
|
102
|
+
fields: nil,
|
103
|
+
filters: where_clauses,
|
104
|
+
alternative_filters: or_clauses
|
105
|
+
).to_h.except(:fields)
|
106
|
+
)
|
101
107
|
end
|
102
108
|
|
103
109
|
# The `each` method turns the `ApiResource` instance into an enumerable object.
|