lib/uploadcare/rails/settings.rb in uploadcare-rails-1.1.0 vs lib/uploadcare/rails/settings.rb in uploadcare-rails-1.1.1
- old
+ new
@@ -29,26 +29,25 @@
:live,
:manual_start,
:path_value
]
-
def initialize(config)
# extract envaroments settings
- settings = config[::Rails.env]
+ settings = config.with_indifferent_access[::Rails.env]
unless settings.present?
raise ArgumentError, 'config is empty or not given at all'
end
# build settings object (basicly openstruct)
# merge defaults with actual settings
# strip defaults suplied by uploadcare-ruby gem from private/pub key
uc_defaults =
- Uploadcare::DEFAULT_SETTINGS.except!(:public_key, :private_key)
+ Uploadcare::DEFAULT_SETTINGS.except(:public_key, :private_key)
- defaults = Uploadcare::Rails::DEFAULT_SETTINGS.merge!(uc_defaults)
- settings = defaults.merge!(settings)
+ defaults = Uploadcare::Rails::DEFAULT_SETTINGS.merge(uc_defaults)
+ settings = defaults.merge(settings)
super settings
# validates settings atributes.
unless valid?
raise ArgumentError, 'Private or public key options were not provided'