mailchimp-rest-api 0.4.0 → 0.4.1
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/VERSION +1 -1
- data/lib/mailchimp-api/pagination/prepare_query_params.rb +10 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bb470c7bf3ad957b57ec7bd7c19299e5594de1de05fc4a24b683da82ee3c998
|
4
|
+
data.tar.gz: d7951ce1b9194282a03b9cd1743b513c11003c3c50f9edce9e839ee38370d795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a59055a5853bd0d54741202c67029f6bbd4bc6f940a65f0fba3150fa36f747d54658aad02da3cd64b9840f51df88e06177af54f44aaaea7af057f877df0c935
|
7
|
+
data.tar.gz: e9b0b7630353f19c94ea8edaaad563288f4adb48c497ff05f2d40779c771d1a341d824eb2bdae1a6ca64dd544a1be0077af5bfbbc5ab9a6c6c658361ce69643c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
@@ -17,8 +17,8 @@ module MailchimpAPI
|
|
17
17
|
prepare_offset(query)
|
18
18
|
prepare_count(query)
|
19
19
|
|
20
|
-
ensure_fields_included(query, items_field: items_field, total_field: "total_items")
|
21
|
-
ensure_fields_not_excluded(query, items_field: items_field, total_field: "total_items")
|
20
|
+
ensure_fields_included(query, items_field: items_field.to_s, total_field: "total_items")
|
21
|
+
ensure_fields_not_excluded(query, items_field: items_field.to_s, total_field: "total_items")
|
22
22
|
query
|
23
23
|
end
|
24
24
|
|
@@ -35,7 +35,14 @@ module MailchimpAPI
|
|
35
35
|
|
36
36
|
def ensure_fields_included(query, items_field:, total_field:)
|
37
37
|
fields = query[:fields] || ""
|
38
|
-
|
38
|
+
fields_list = fields.split(",")
|
39
|
+
|
40
|
+
has_items_field = fields_list.any? { |field| field.start_with?("#{items_field}.") }
|
41
|
+
has_total_field = fields_list.include?(total_field)
|
42
|
+
|
43
|
+
fields_list.push(items_field) unless has_items_field
|
44
|
+
fields_list.push(total_field) unless has_total_field
|
45
|
+
query[:fields] = fields_list.uniq.join(",")
|
39
46
|
end
|
40
47
|
|
41
48
|
def ensure_fields_not_excluded(query, items_field:, total_field:)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailchimp-rest-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Glushkov
|
@@ -52,7 +52,7 @@ metadata:
|
|
52
52
|
changelog_uri: https://github.com/andreyruby/mailchimp-rest-api/CHANGELOG.md
|
53
53
|
documentation_uri: https://github.com/andreyruby/mailchimp-rest-api/README.md
|
54
54
|
homepage_uri: https://github.com/andreyruby/mailchimp-rest-api
|
55
|
-
source_code_uri: https://github.com/andreyruby/mailchimp-rest-api/tree/v0.4.
|
55
|
+
source_code_uri: https://github.com/andreyruby/mailchimp-rest-api/tree/v0.4.1
|
56
56
|
rdoc_options: []
|
57
57
|
require_paths:
|
58
58
|
- lib
|