huacnlee / rails-settings-cached

Global settings for your Rails application.
Other
1.06k stars 202 forks source link

0.7.1 introduced breaking changes. #146

Closed webzorg closed 5 years ago

webzorg commented 6 years ago

The error message was vague and I spent 1 whole day to find a faulty commit in haystack. No connection pool with 'primary' found. Specifically, the error is in initializer and the 0.7.1 is mentioning that in changenotes specifically. To be more clear, the bug doesn't affect 0.7.0, only 0.7.1.

My Setting model contains the following:

class Setting < RailsSettings::Base
  source Rails.root.join("config", "app.yml")
  namespace Rails.env
end

The stack trace also complained about namespace line but when I removed, the same error applied. IMPORTANT! - It ONLY reproduces in production. Works fine in development, don't let it fool you!