Skip to content

Commit

Permalink
Merge pull request #52668 from neilvcarvalho/nc-per-attribute-encrypt…
Browse files Browse the repository at this point in the history
…ion-docs

Fix attribute-specific encryption options [ci skip]
  • Loading branch information
rafaelfranca committed Aug 21, 2024
1 parent 57a6916 commit 71030e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions guides/source/active_record_encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,19 +356,19 @@ Both methods return `ActiveRecord::Encryption::Key` objects:

A key can include arbitrary tags that will be stored unencrypted with the message. You can use `ActiveRecord::Encryption::Message#headers` to examine those values when decrypting.

### Model-specific Key Providers
### Attribute-specific Key Providers

You can configure a key provider on a per-class basis with the `:key_provider` option:
You can configure a key provider on a per-attribute basis with the `:key_provider` option:

```ruby
class Article < ApplicationRecord
encrypts :summary, key_provider: ArticleKeyProvider.new
end
```

### Model-specific Keys
### Attribute-specific Keys

You can configure a given key on a per-class basis with the `:key` option:
You can configure a given key on a per-attribute basis with the `:key` option:

```ruby
class Article < ApplicationRecord
Expand Down

0 comments on commit 71030e5

Please sign in to comment.