contentful-management 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/contentful/management/entry.rb +0 -13
- data/lib/contentful/management/organization.rb +1 -1
- data/lib/contentful/management/resource.rb +4 -0
- data/lib/contentful/management/resource/fields.rb +3 -4
- data/lib/contentful/management/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/organization/all.yml +1 -1
- data/spec/lib/contentful/management/entry_spec.rb +4 -4
- 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: 6cf0ce9eb8d18998ab777ab796c1fb0222cb8c8092fd55734e3c7c2031641d47
|
4
|
+
data.tar.gz: ff63153a45ca73048e2bd563a7641dc5dc7e31a4877e4873e418efeabf5e185c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa3b3a247c2ac6a168489665124f1875dfb48aed89799ae66f9074415b4cbbbf706c35cf5d4312f0507eb0afff739bfe5c92212c1123756a296bf185b152168c
|
7
|
+
data.tar.gz: 339fecccc7901697cdc4c89ed67110af4308777156544b800ac1bed1150a8b9615e48c30a788b3a6337f15d9e955ff8eca283eb12ab4f0270bcda9b87ed76e81
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## Master
|
4
4
|
|
5
|
+
## 2.2.2
|
6
|
+
### Fixed
|
7
|
+
* Fixed URL generation for `/organizations` endpoint.
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
**BREAKING CHANGES**:
|
11
|
+
* `nil` values on localized entries now no longer fallback to the default locale value when reading them. [#164](https://github.com/contentful/contentful-management.rb/issues/164)
|
12
|
+
|
5
13
|
## 2.2.1
|
6
14
|
### Fixed
|
7
15
|
* Fixed side-effect that was causing entries created using `content_type.entries.new` to fail to save.
|
@@ -130,19 +130,6 @@ module Contentful
|
|
130
130
|
self.locale = attributes[:locale] || client.default_locale
|
131
131
|
end
|
132
132
|
|
133
|
-
# Gets Hash of fields for the current locale
|
134
|
-
#
|
135
|
-
# @param [String] wanted_locale
|
136
|
-
#
|
137
|
-
# @return [Hash] localized fields
|
138
|
-
def fields(wanted_locale = locale)
|
139
|
-
requested_locale = wanted_locale || default_locale
|
140
|
-
@fields[requested_locale] = {} unless @fields[requested_locale]
|
141
|
-
|
142
|
-
default_fields = @fields[default_locale] || {}
|
143
|
-
default_fields.merge(@fields[requested_locale])
|
144
|
-
end
|
145
|
-
|
146
133
|
# If an entry is a new object gets created in the Contentful, otherwise the existing entry gets updated.
|
147
134
|
# @see _ README for details.
|
148
135
|
#
|
@@ -10,10 +10,9 @@ module Contentful
|
|
10
10
|
# @param [String] wanted_locale
|
11
11
|
#
|
12
12
|
# @return [Hash] localized fields
|
13
|
-
def fields(wanted_locale =
|
14
|
-
|
15
|
-
@fields
|
16
|
-
@fields[requested_locale]
|
13
|
+
def fields(wanted_locale = nil)
|
14
|
+
wanted_locale = internal_resource_locale if wanted_locale.nil?
|
15
|
+
@fields.fetch(wanted_locale.to_s, {})
|
17
16
|
end
|
18
17
|
|
19
18
|
# @private
|
@@ -730,14 +730,14 @@ describe Contentful::Management::Entry do
|
|
730
730
|
end
|
731
731
|
end
|
732
732
|
|
733
|
-
it '
|
733
|
+
it 'does not retrieve value of default locale if it has not been localized' do
|
734
734
|
vcr('entry/locales/fallback_to_default_locale') do
|
735
735
|
space = client.spaces.find('0agypmo1waov')
|
736
736
|
entry = client.entries(space.id, 'master').find('4epXENbO8wsaOukgqquYcI')
|
737
737
|
entry.locale = 'de-DE'
|
738
738
|
|
739
|
-
expect(entry.fields.count).to eq
|
740
|
-
expect(entry.fields
|
739
|
+
expect(entry.fields.count).to eq 0
|
740
|
+
expect(entry.fields).to eq({})
|
741
741
|
end
|
742
742
|
end
|
743
743
|
|
@@ -764,7 +764,7 @@ describe Contentful::Management::Entry do
|
|
764
764
|
entry.yolo_with_locales = {'de-DE' => 'changed'}
|
765
765
|
entry.locale = 'de-DE'
|
766
766
|
|
767
|
-
expect(entry.fields).to match(
|
767
|
+
expect(entry.fields).to match(:yolo => 'changed')
|
768
768
|
end
|
769
769
|
end
|
770
770
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful-management
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Protas
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-08-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: http
|