diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-07-23 17:33:06 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-07-24 14:44:44 +0300 |
commit | edf1c1fccf156b8789814be80f3a17b57afd38d1 (patch) | |
tree | 2de1d3824f0c67c8e6ba4bec0d35c843ab49bb4e /config/object_store_settings.rb | |
parent | a3f1592b898ce01bcf516ba0d16a4606868c2743 (diff) |
Make ObjectStoreSettings use more explicit and add specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'config/object_store_settings.rb')
-rw-r--r-- | config/object_store_settings.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/config/object_store_settings.rb b/config/object_store_settings.rb index 7bf05622bac..d85ff394dcc 100644 --- a/config/object_store_settings.rb +++ b/config/object_store_settings.rb @@ -1,13 +1,15 @@ # Set default values for object_store settings class ObjectStoreSettings - def initialize(object_store) + def self.parse(object_store) object_store ||= Settingslogic.new({}) object_store['enabled'] = false if object_store['enabled'].nil? object_store['remote_directory'] ||= nil object_store['direct_upload'] = false if object_store['direct_upload'].nil? object_store['background_upload'] = true if object_store['background_upload'].nil? object_store['proxy_download'] = false if object_store['proxy_download'].nil? + # Convert upload connection settings to use string keys, to make Fog happy object_store['connection']&.deep_stringify_keys! + object_store end end |