forked from hashicorp/vault-rails
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Persisting Vault attributes on an `after_save` uses two separate queries: one for the model `INSERT/UPDATE`, and another to `UPDATE` the ciphertext for the encrypted attributes. Encrypting the attributes with a `before_save` avoids the second query. In some cases users might _not_ want to have two queries when saving a single record. This would be necessary for example, when one has an auditing table and/or stored procedures that take some action when a record is changed.
- Loading branch information
1 parent
71d4806
commit 3889fa1
Showing
2 changed files
with
66 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters