contentful-scheduler-custom 1.6.7.5320 → 1.6.7.5321
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/contentful/scheduler/tasks/publish.rb +7 -6
- data/lib/contentful/scheduler/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: 81a550baf2d9512bb2e6ba2d83b0579b95ed34561502b4eeeec273995b34feb6
|
4
|
+
data.tar.gz: 8c1995b9d3095f43a80f75ad7a4824580d869c4a4c47e5a7cf4b4b2a006dae20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57fb9d9337402150a8d9094f2373035d6e5d724510292b3b86a770be641bdb2358cb12513b3095bd86c28b6f5894fc52e1ed6233cbbd91cfde1f6602d3ba5242
|
7
|
+
data.tar.gz: 2bd67c1925cd56fceae36366699105ba1e327cbb08d432714683c3dafcaca710e314f783f9196039f545de34282448783ec99f660a5c73220a2f7ac2acd776f9
|
@@ -27,7 +27,7 @@ module Contentful
|
|
27
27
|
linked_enteries = client1.entries(links_to_entry: entry_id)
|
28
28
|
|
29
29
|
if !linked_enteries.raw["includes"].nil? && !linked_enteries.raw["includes"]["Entry"].nil?
|
30
|
-
|
30
|
+
logger.info "CHuby raw element is ==> #{linked_enteries.raw["includes"]["Entry"]}"
|
31
31
|
linkedEnteriesId = extract_element_ids(linked_enteries.raw["includes"]["Entry"])
|
32
32
|
logger.info("Linked enteries are #{linkedEnteriesId}")
|
33
33
|
linkedEnteriesId.each do |id|
|
@@ -39,20 +39,20 @@ module Contentful
|
|
39
39
|
client.entries.find(space_id, entry_id).publish
|
40
40
|
end
|
41
41
|
|
42
|
-
def self.extract_element_ids
|
42
|
+
def self.extract_element_ids input_array
|
43
43
|
ids = []
|
44
|
-
input_array.each {|item| (ids << (get_each_field item)).flatten!}
|
45
|
-
|
44
|
+
input_array.each {|item| (ids << (get_each_field item )).flatten!}
|
45
|
+
puts ids.uniq
|
46
46
|
end
|
47
47
|
|
48
|
-
def self.get_each_field
|
48
|
+
def self.get_each_field item
|
49
49
|
ids = []
|
50
50
|
keys = item["fields"].keys
|
51
51
|
keys.each {|key| (ids << (get_each_element key, item["fields"])).flatten!}
|
52
52
|
return ids
|
53
53
|
end
|
54
54
|
|
55
|
-
def self.get_each_element
|
55
|
+
def self.get_each_element key, item
|
56
56
|
ids = []
|
57
57
|
if item[key].kind_of?(Array)
|
58
58
|
item[key].each {|i| (!(i["sys"]["linkType"].nil?) && i["sys"]["linkType"] == "Entry") ? ids.push(i["sys"]["id"]) : nil}
|
@@ -61,6 +61,7 @@ module Contentful
|
|
61
61
|
end
|
62
62
|
return ids
|
63
63
|
end
|
64
|
+
|
64
65
|
end
|
65
66
|
end
|
66
67
|
end
|