dato-dump 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dato_dump/dumper.rb +1 -1
- data/lib/dato_dump/record_dumper.rb +8 -1
- data/lib/dato_dump/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0acb3cd3803786090b9daac375842579e4cb8cf
|
4
|
+
data.tar.gz: 77aa5c416d8c3ab465d81ff0ed41e45ea957f4e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e585aac8dd071527e24eddd5e31ab16fcd5c8881361b47562f61c9061c90f2cc7894e77b2d240f977cfca2809d93c601826d8f85348dede18b7053611a9b4521
|
7
|
+
data.tar.gz: bc58cbe15edd9b97c6ddcf20203e0777f271589e17154c3c82409f1639411c595dc9ccc70ce7926dbe1094b69ec25cbc412dee32a8602b048375970cb944d1ad
|
data/lib/dato_dump/dumper.rb
CHANGED
@@ -29,7 +29,7 @@ module DatoDump
|
|
29
29
|
end
|
30
30
|
|
31
31
|
collections_by_type.each do |key, value|
|
32
|
-
path = File.join(configuration.destination_path, key + ".
|
32
|
+
path = File.join(configuration.destination_path, key + ".json")
|
33
33
|
File.open(path, 'w') do |file|
|
34
34
|
file.write JSON.pretty_generate(value)
|
35
35
|
end
|
@@ -13,12 +13,19 @@ module DatoDump
|
|
13
13
|
|
14
14
|
def dump
|
15
15
|
attributes = { id: record.id }
|
16
|
-
record.content_type
|
16
|
+
content_type = record.content_type
|
17
|
+
|
18
|
+
content_type.fields.each do |field|
|
17
19
|
attributes[field.api_key] = dump_attribute(
|
18
20
|
record.send(field.api_key),
|
19
21
|
field
|
20
22
|
)
|
21
23
|
end
|
24
|
+
|
25
|
+
if content_type.sortable
|
26
|
+
attributes["position"] = record.position
|
27
|
+
end
|
28
|
+
|
22
29
|
attributes.to_h
|
23
30
|
end
|
24
31
|
|
data/lib/dato_dump/version.rb
CHANGED