Merge pull request #48556 from skipkayhil/hm-fix-encrypted-config-hash
Fix EncryptedConfiguration not behaving like Hash
This commit is contained in:
commit
06da26afba
@ -1,3 +1,8 @@
|
||||
* Fix `EncryptedConfiguration` returning incorrect values for some `Hash`
|
||||
methods
|
||||
|
||||
*Hartley McGuire*
|
||||
|
||||
* Don't show secrets for `MessageEncryptor#inspect`.
|
||||
|
||||
Before:
|
||||
|
@ -92,7 +92,7 @@ def deep_transform(hash)
|
||||
end
|
||||
|
||||
def options
|
||||
@options ||= ActiveSupport::InheritableOptions.new(deep_transform(config))
|
||||
@options ||= deep_transform(config)
|
||||
end
|
||||
|
||||
def deserialize(content)
|
||||
|
@ -45,6 +45,7 @@ class EncryptedConfigurationTest < ActiveSupport::TestCase
|
||||
assert_not @credentials.something.bad
|
||||
assert_equal "bar", @credentials.dig(:something, :nested, :foo)
|
||||
assert_equal "bar", @credentials.something.nested.foo
|
||||
assert_equal [:something], @credentials.keys
|
||||
assert_equal [:good, :bad, :nested], @credentials.something.keys
|
||||
assert_equal ({ good: true, bad: false, nested: { foo: "bar" } }), @credentials.something
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user