{"action":"created","issue":{"url":"https://api.github.com/repos/errorstudio/contentful_model/issues/13","labels_url":"https://api.github.com/repos/errorstudio/contentful_model/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/errorstudio/contentful_model/issues/13/comments","events_url":"https://api.github.com/repos/errorstudio/contentful_model/issues/13/events","html_url":"https://github.com/errorstudio/contentful_model/issues/13","id":96696410,"number":13,"title":"Configuration is lost after initialization","user":{"login":"TrevorBramble","id":92880,"avatar_url":"https://avatars.githubusercontent.com/u/92880?v=3","gravatar_id":"","url":"https://api.github.com/users/TrevorBramble","html_url":"https://github.com/TrevorBramble","followers_url":"https://api.github.com/users/TrevorBramble/followers","following_url":"https://api.github.com/users/TrevorBramble/following{/other_user}","gists_url":"https://api.github.com/users/TrevorBramble/gists{/gist_id}","starred_url":"https://api.github.com/users/TrevorBramble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrevorBramble/subscriptions","organizations_url":"https://api.github.com/users/TrevorBramble/orgs","repos_url":"https://api.github.com/users/TrevorBramble/repos","events_url":"https://api.github.com/users/TrevorBramble/events{/privacy}","received_events_url":"https://api.github.com/users/TrevorBramble/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-23T00:17:52Z","updated_at":"2015-07-27T14:25:03Z","closed_at":"2015-07-27T14:25:03Z","body":"Completely new Rails 4.2.3 application. The only changes to the Gemfile have been removal of Spring, addition of dotenv, and the latest contentful_rails and contentful_model gems as published on rubygems.org.\r\n\r\nI added an initializer as shown in the README.\r\n\r\n```\r\n$ cat config/initializers/contentful_model.rb \r\nContentfulModel.configure do |config|\r\n  byebug\r\n  config.access_token         = ENV['CONTENTFUL_ACCESS_TOKEN']\r\n  config.preview_access_token = ENV['CONTENTFUL_PREVIEW_ACCESS_TOKEN']\r\n  config.space                = ENV['CONTENTFUL_SPACE']\r\n#  config.options              = {\r\n    #extra options to send to the Contentful::Client\r\n#  }\r\nend\r\n```\r\n\r\nAnd I defined one model, Category.\r\n```\r\n$ cat app/models/category.rb \r\nclass Category < ContentfulModel::Base\r\n   self.content_type_id = \"[category content type string]\"\r\nend\r\n```\r\n\r\nSo here's what happens when I fire up the Rails console:\r\n```\r\n$ rails c\r\n\r\n[1, 9] in /home/trevor/code/chef/www-contentful-rails/config/initializers/contentful_model.rb\r\n   1: ContentfulModel.configure do |config|\r\n   2:   config.access_token         = ENV['CONTENTFUL_ACCESS_TOKEN']\r\n   3:   config.preview_access_token = ENV['CONTENTFUL_PREVIEW_ACCESS_TOKEN']\r\n   4:   config.space                = ENV['CONTENTFUL_SPACE']\r\n   5: #  config.options              = {\r\n   6:     #extra options to send to the Contentful::Client\r\n   7: #  }\r\n   8:   byebug\r\n=> 9: end\r\n(byebug) ContentfulModel.configuration\r\n#<ContentfulModel::Configuration:0x00000005bc7be0 @access_token=\"[my actual token string]\", @e\r\nntry_mapping={}, @preview_access_token=\"[my actual preview token string]\", @space=\"[my actual \r\nspace]\">\r\n(byebug) continue\r\n/home/trevor/.rvm/gems/ruby-2.2.2@www-contentful-rails/gems/actionpack-4.2.3/lib/action_dispat\r\nch/http/mime_type.rb:163: warning: already initialized constant Mime::JSON                    \r\n/home/trevor/.rvm/gems/ruby-2.2.2@www-contentful-rails/gems/actionpack-4.2.3/lib/action_dispat\r\nch/http/mime_type.rb:163: warning: previous definition of JSON was here                       \r\nLoading development environment (Rails 4.2.3)\r\n2.2.2 :001 > ContentfulModel.configuration\r\n => #<ContentfulModel::Configuration:0x00000005bc7be0 @access_token=nil, @entry_mapping={\"[cat\r\negory content type string]\"=>Category}, @preview_access_token=nil, @space=nil>                        \r\n2.2.2 :002 > \r\n```\r\n\r\nI've spent a bunch of time sifting the gem source and stepping through the debugger without results. Any ideas?"},"comment":{"url":"https://api.github.com/repos/errorstudio/contentful_model/issues/comments/125224656","html_url":"https://github.com/errorstudio/contentful_model/issues/13#issuecomment-125224656","issue_url":"https://api.github.com/repos/errorstudio/contentful_model/issues/13","id":125224656,"user":{"login":"edtjones","id":4377783,"avatar_url":"https://avatars.githubusercontent.com/u/4377783?v=3","gravatar_id":"","url":"https://api.github.com/users/edtjones","html_url":"https://github.com/edtjones","followers_url":"https://api.github.com/users/edtjones/followers","following_url":"https://api.github.com/users/edtjones/following{/other_user}","gists_url":"https://api.github.com/users/edtjones/gists{/gist_id}","starred_url":"https://api.github.com/users/edtjones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edtjones/subscriptions","organizations_url":"https://api.github.com/users/edtjones/orgs","repos_url":"https://api.github.com/users/edtjones/repos","events_url":"https://api.github.com/users/edtjones/events{/privacy}","received_events_url":"https://api.github.com/users/edtjones/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T14:25:03Z","updated_at":"2015-07-27T14:25:03Z","body":"@TrevorBramble I can see the issue. I fixed in https://github.com/errorstudio/contentful_rails/issues/7 and have release gem version 0.2.2.2 - thanks for the heads up :-)"}}