contentful-database-importer 0.3.1 → 0.3.2
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/CHANGELOG.md +7 -0
- data/lib/contentful/database_importer/resource_bootstrap_class_methods.rb +1 -1
- data/lib/contentful/database_importer/resource_class_methods.rb +4 -2
- data/lib/contentful/database_importer/resource_coercions.rb +6 -2
- data/lib/contentful/database_importer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b17382659fb9cb37caad7dcc726b1d8b1bf8e832
|
4
|
+
data.tar.gz: 6991bbcd25ed0283426a4fdcb08de456ec712189
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f22eb2bf0b1a2c997130526d5e4e747f7e9ef2b1f6ac5aac2e7554516ad6b05127444828f2cf0d08480c328c3339f2f18893dd85cd91aa3b486062caf853715d
|
7
|
+
data.tar.gz: d3ae25e2559afaa74439bad1e50ed450e165ea9ca5fd4ca58216b46dfef629b5aa104b6d0ff36d99ff405df16380b182e92b7faf8aa4059bd5b63915c751cdda
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 0.3.2
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
* Excluded Fields are no longer part of the Content Type definition
|
9
|
+
* Display Fields no longer take into account excluded fields
|
10
|
+
* Asset IDs no longer contain non-valid characters
|
11
|
+
|
5
12
|
## 0.3.1
|
6
13
|
|
7
14
|
### Fixed
|
@@ -53,9 +53,11 @@ module Contentful
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def display_field
|
56
|
-
|
56
|
+
default_display_field = fields.reject { |f| f[:exclude_from_output] }.find do |f|
|
57
57
|
f[:type] == :string || f[:type] == :symbol
|
58
|
-
end || {}
|
58
|
+
end || {}
|
59
|
+
|
60
|
+
@display_field || default_display_field[:maps_to]
|
59
61
|
end
|
60
62
|
|
61
63
|
def display_field=(field_name)
|
@@ -88,7 +88,7 @@ module Contentful
|
|
88
88
|
def create_associated_asset(name, value)
|
89
89
|
extension = value.split('.').last
|
90
90
|
associated_assets << {
|
91
|
-
id:
|
91
|
+
id: asset_id_from_name(name),
|
92
92
|
title: name,
|
93
93
|
file: {
|
94
94
|
filename: name,
|
@@ -107,9 +107,13 @@ module Contentful
|
|
107
107
|
|
108
108
|
{
|
109
109
|
linkType: 'Asset',
|
110
|
-
id:
|
110
|
+
id: asset_id_from_name(name)
|
111
111
|
}
|
112
112
|
end
|
113
|
+
|
114
|
+
def asset_id_from_name(name)
|
115
|
+
Support.snake_case(name.gsub(/[^\w ]/i, '_'))
|
116
|
+
end
|
113
117
|
end
|
114
118
|
end
|
115
119
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful-database-importer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contentful GmbH (David Litvak Bruno)
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: contentful_bootstrap
|