lib/kms_encrypted.rb in kms_encrypted-0.1.1 vs lib/kms_encrypted.rb in kms_encrypted-0.1.2
- old
+ new
@@ -6,10 +6,11 @@
def self.kms
@kms ||= Aws::KMS::Client.new
end
module Model
- def has_kms_key(key_id, name: nil)
+ def has_kms_key(legacy_key_id = nil, name: nil, key_id: nil)
+ key_id ||= legacy_key_id || ENV["KMS_KEY_ID"]
raise ArgumentError, "Missing key id" unless key_id
key_method = name ? "kms_key_#{name}" : "kms_key"
class_eval do