-
Notifications
You must be signed in to change notification settings - Fork 42
Lost configuration on ContentfulModel::Management.new #131
Description
This is related to #130.
I'm not sure if this is a bug in this library or contentful/contentful-management.rb.
In the initialiser for Contentful::Management::Client the initialised object is saved to a thread variable.
The thread variable is accessed via the shared_instance method in various places in contentful/contentful-management.rb. Any new initialisation of Contentful::Management::Client overwrites the thread variable, causing subsequent calls within contentful/contentful-management.rb to use the new instance, with the new configuration. This caused me issues with default_locale, which I dealt with in #130. I guess this could also cause issues with options like raise_errors.
As I said, I'm not sure if this is a bug in this library or contentful/contentful-management.rb. The behaviour in contentful/contentful-management.rb is by-design so perhaps this library should be made to use the shared_instance variable.