lib/lockbox/railtie.rb in lockbox-0.6.1 vs lib/lockbox/railtie.rb in lockbox-0.6.2
- old
+ new
@@ -1,9 +1,10 @@
module Lockbox
class Railtie < Rails::Railtie
initializer "lockbox" do |app|
if defined?(Rails.application.credentials)
- Lockbox.master_key ||= Rails.application.credentials.dig(:lockbox, :master_key)
+ # needs to work when lockbox key has a string value
+ Lockbox.master_key ||= Rails.application.credentials.try(:lockbox).try(:fetch, :master_key, nil)
end
require "lockbox/carrier_wave_extensions" if defined?(CarrierWave)
if defined?(ActiveStorage)