huacnlee / rails-settings-cached

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

On version 0.7.1, when use setting in production.rb will raise error! #145

Closed tianlu1677 closed 6 years ago

tianlu1677 commented 6 years ago

For example

Rails.application.configure do
   if Setting.asset_host.present?
       config.action_controller.asset_host = Setting.asset_host
  end
end

It try to connection database, but on this time , active_record is not working, in version 0.7.1 So I use v0.6.6. The diff is change

huacnlee commented 6 years ago

You must setup asset_host in yml config file, because when Rails initializing, Active Record is not ready, so rails-settings-cached can't read the value from database.

By the way, asset_host is a static config, it can't change after Rails started, so you don't need change online.