contentful / contentful_model

A lightweight wrapper around the Contentful api gem, to make it behave more like ActiveRecord
MIT License
44 stars 42 forks source link

Fix loss of configured default_locale #130

Closed MattFenelon closed 5 years ago

MattFenelon commented 5 years ago

Some of the configuration values are being lost because ContentfulModel::Management is created without the configured values in some locations. ContentfulModel::Migrations::ContentTypeFactory.find, for example, creates an instance of ContentfulModel::Management with no configuration.

This change centralises the configuration into ContentfulModel::Management.initialize so that all instances use the configured values, such as default_locale.

Losing default_locale causes errors when a space is configured without the default en-US locale.