wdw_sources 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/wdw_sources/touringplans_update.rb +19 -9
- data/lib/wdw_sources/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: af4dce345954fdfb0f519f8d08adeb8957f212da046d18dc79f1c61a7fa13cbc
|
4
|
+
data.tar.gz: 44f993ac032e04b56e94b3c02b86eee1287dbcdede3bee00e427bee95f7d5d89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d0f9b3cb1ebcb9782f0c73567aab72831b8538e59f2d5709803bb99e845c98bbfea3c222b0121e2cd568a4e86b3945e73a2ac2603a0179b3a8f3b568a7125d5
|
7
|
+
data.tar.gz: 1e4883a7606721a759274d39c3ebaaaa7d548abf08ea729c95250fe7367b440d84464d61d3b8b5cdad796cc8832178ade44bce9aeae9a76fa9bd785bcd622690
|
@@ -10,23 +10,33 @@ module WdwSources
|
|
10
10
|
|
11
11
|
tp_list = Touringplans.list_all(interest)
|
12
12
|
tp_list.each do |tp_list_item|
|
13
|
-
|
13
|
+
tp_list_item_venue_permalink = tp_list_item.venue_permalink
|
14
|
+
tp_list_item_permalink = tp_list_item.permalink
|
15
|
+
|
16
|
+
_cache_tp_place(tp_list_item_venue_permalink, tp_list_item_permalink, interest)
|
14
17
|
end
|
15
18
|
end
|
16
19
|
|
17
|
-
def self._cache_tp_place(
|
18
|
-
|
20
|
+
def self._cache_tp_place(tp_list_item_venue_permalink, tp_list_item_permalink, interest)
|
21
|
+
return "Missing tp_list_item_venue_permalink" if tp_list_item_venue_permalink.to_s.length < 3
|
22
|
+
return "Missing tp_list_item_permalink" if tp_list_item_permalink.to_s.length < 3
|
23
|
+
return "Missing interest" if interest.to_s.length < 3
|
19
24
|
|
20
|
-
cache_resources = {attractions
|
21
|
-
dining
|
22
|
-
hotels
|
25
|
+
cache_resources = {"attractions" => WdwSources::TouringplansAttraction,
|
26
|
+
"dining" => WdwSources::TouringplansDiningVenue,
|
27
|
+
"hotels" => WdwSources::TouringplansHotel
|
23
28
|
}
|
24
29
|
|
25
30
|
cache_resource = cache_resources[interest]
|
26
|
-
cache_item = cache_resource.find_or_create_by(permalink:
|
31
|
+
cache_item = cache_resource.find_or_create_by(permalink: tp_list_item_permalink)
|
32
|
+
|
33
|
+
tp_item_full_record = Touringplans.show(tp_list_item_venue_permalink,interest, tp_list_item_permalink)
|
27
34
|
|
28
|
-
|
29
|
-
|
35
|
+
vp = {venue_permalink: tp_list_item_venue_permalink}
|
36
|
+
full_record_hash = vp.merge(tp_item_full_record.to_h)
|
37
|
+
cache_item.update!(full_record_hash)
|
38
|
+
# tp_item_full_record.to_h
|
39
|
+
cache_item
|
30
40
|
end
|
31
41
|
|
32
42
|
# def self.cache_all_hotels
|
data/lib/wdw_sources/version.rb
CHANGED