略過本文 略過搜尋

當嘗試加密資料時,NullEncryptor 會觸發錯誤

當您想要揭示密碼文字以進行除錯時,而且您想要確保不會使用錯誤內容覆寫任何可加密屬性,這很有用。

方法
B
D
E

實例公開方法

binary?()

# File activerecord/lib/active_record/encryption/read_only_null_encryptor.rb, line 23
def binary?
  false
end

decrypt(encrypted_text, key_provider: nil, cipher_options: {})

# File activerecord/lib/active_record/encryption/read_only_null_encryptor.rb, line 15
def decrypt(encrypted_text, key_provider: nil, cipher_options: {})
  encrypted_text
end

encrypt(clean_text, key_provider: nil, cipher_options: {})

# File activerecord/lib/active_record/encryption/read_only_null_encryptor.rb, line 11
def encrypt(clean_text, key_provider: nil, cipher_options: {})
  raise Errors::Encryption, "This encryptor is read-only"
end

encrypted?(text)

# File activerecord/lib/active_record/encryption/read_only_null_encryptor.rb, line 19
def encrypted?(text)
  false
end