contentful-management 2.9.0 → 2.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eab2699745e66fdf31687b99ba2105e59a1bd4a378ba0f4418ebbd3d9e528545
4
- data.tar.gz: f4ca387a625b6461b160372136b76ee6228c79357a8be9f356428350e4784e9d
3
+ metadata.gz: 4874bf1c1821fdad9b895fb83cfb53f01dbeb161220c2d5e35f6b266b70a75bc
4
+ data.tar.gz: 31a641e0b306c5608187591ca2eb7f89024952ece5989243683c2d7ff3effa5a
5
5
  SHA512:
6
- metadata.gz: 3acfd6e9399c6d250f1340542250050cb9301230fc5cce2bbf0da9d657a8d67bbaf1319185f519567fb2bf9a32d6a540a4f27665600e09a5ea2ee9298ef32cd6
7
- data.tar.gz: a018f28bd8f836f5aafebd6a25ca666c376976f62ce22fb997133562d4f5654257be68ae6035f833f1de1613311596c062c4c05f8d7a94f487fce0be4192539d
6
+ metadata.gz: e8eb04ac563ffc9e81b47dd2078023d27caa879472c96ea02863e2491819b9bcc2f6e73f25d636ebc2957e40863dc76afbd2bdb4b63232b2dbb2c59012670c58
7
+ data.tar.gz: a2332fbc5da6136910d0f7232cc8a9ca6d545aaec1804cdce12f6c8272f086f6951bf90fd6e668d1b002f55cccac9c02ca29a834b8c34a6d69f122ecaa030d92
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 2.9.1
6
+ ### Fixed
7
+ * Default locale is now fetched from the client instead of passed around. [#194](https://github.com/contentful/contentful-management.rb/pull/194)
8
+
5
9
  ## 2.9.0
6
10
  ### Added
7
11
  * Added validations for Rich Text. [#193](https://github.com/contentful/contentful-management.rb/pull/193)
@@ -139,8 +139,9 @@ module Contentful
139
139
  # @return [String]
140
140
  def find_locale
141
141
  locale = locales.all.detect(&:default)
142
- return locale.code unless locale.nil?
143
- @default_locale
142
+ return locale.code if locale
143
+
144
+ default_locale
144
145
  end
145
146
 
146
147
  # @private
@@ -27,18 +27,16 @@ module Contentful
27
27
  }.freeze
28
28
  # rubocop:enable Style/DoubleNegation
29
29
 
30
- attr_reader :properties, :request, :default_locale, :raw_object
30
+ attr_reader :properties, :request, :raw_object
31
31
  attr_accessor :client
32
32
 
33
33
  # @private
34
34
  def initialize(object = nil,
35
35
  request = nil,
36
36
  client = nil,
37
- nested_locale_fields = false,
38
- default_locale = Contentful::Management::Client::DEFAULT_CONFIGURATION[:default_locale])
37
+ nested_locale_fields = false)
39
38
  self.class.update_coercions!
40
39
  @nested_locale_fields = nested_locale_fields
41
- @default_locale = default_locale
42
40
 
43
41
  @properties = extract_from_object object, :property, self.class.property_coercions.keys
44
42
  @request = request
@@ -134,6 +132,11 @@ module Contentful
134
132
  nil
135
133
  end
136
134
 
135
+ # Get default_locale from client
136
+ def default_locale
137
+ client.default_locale
138
+ end
139
+
137
140
  protected
138
141
 
139
142
  def update_headers
@@ -73,7 +73,6 @@ module Contentful
73
73
  @included_resources = {}
74
74
  @known_resources = Hash.new { |hash, key| hash[key] = {} }
75
75
  @nested_locales = true
76
- @default_locale = (client.configuration || Contentful::Management::Client::DEFAULT_CONFIGURATION)[:default_locale]
77
76
  @resource_mapping = default_resource_mapping.merge(resource_mapping)
78
77
  @entry_mapping = default_entry_mapping.merge(entry_mapping)
79
78
  end
@@ -113,7 +112,7 @@ module Contentful
113
112
  def create_resource(object)
114
113
  res_class = detect_resource_class(object)
115
114
  @nested_locales ||= res_class.nested_locale_fields?
116
- res = res_class.new(object, response.request, client, @nested_locales, @default_locale)
115
+ res = res_class.new(object, response.request, client, @nested_locales)
117
116
 
118
117
  add_to_known_resources res
119
118
  replace_children res, object
@@ -3,6 +3,6 @@ module Contentful
3
3
  # Management Namespace
4
4
  module Management
5
5
  # Gem Version
6
- VERSION = '2.9.0'.freeze
6
+ VERSION = '2.9.1'.freeze
7
7
  end
8
8
  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.9.0
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Protas