Skip to content

Commit fc7636f

Browse files
authored
Add validate! command to EncryptedConfiguration (#147)
Resolves #145
1 parent 96f887c commit fc7636f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/diffcrypt/rails/encrypted_configuration.rb

+8
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ def change(&block)
8080
writing read, &block
8181
end
8282

83+
def validate! # :nodoc:
84+
deserialize(read).each_key do |key|
85+
key.to_sym
86+
rescue NoMethodError
87+
raise InvalidKeyError.new(content_path, key)
88+
end
89+
end
90+
8391
protected
8492

8593
# rubocop:disable Metrics/AbcSize

0 commit comments

Comments
 (0)