1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Encryption guide copy fixes [ci skip]

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
This commit is contained in:
Henrik Nyh 2021-04-08 21:39:04 +01:00 committed by GitHub
parent 2a796915f7
commit ad654a8dd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,7 +134,7 @@ end
You might need to ignore case when querying deterministically encrypted data. There are two options that can help you here.
You can use the option `:downcase` when declaring the encrypted attribute. This will make that content is downcased before being encrypted.
You can use the `:downcase` option when declaring the encrypted attribute to downcase the content before encryption occurs.
```ruby
class Person
@ -142,7 +142,7 @@ class Person
end
```
When using `:downcase` the original case is lost. There might be cases where you need to preserve the original case when reading the value, but you need to ignore the case when querying. For those cases you can use the option `:ignore_case` which requires you to add a new column named `original_<column_name>` to store the content with the case unchanged:
When using `:downcase`, the original case is lost. In some situations, you might want to ignore the case only when querying, while also storing the original case. For those situations, you can use the option `:ignore_case`. This requires you to add a new column named `original_<column_name>` to store the content with the case unchanged:
```ruby
class Label