Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix encryption of column default values
Prior to this commit, encrypted attributes that used column default values appeared to be encrypted on create, but were not: ```ruby Book.encrypts :name book = Book.create! book.name # => "<untitled>" book.name_before_type_cast # => "{\"p\":\"abc..." book.reload.name_before_type_cast # => "<untitled>" ``` This commit ensures attributes with column default values are encrypted: ```ruby Book.encrypts :name book = Book.create! book.name # => "<untitled>" book.name_before_type_cast # => "{\"p\":\"abc..." book.reload.name_before_type_cast # => "{\"p\":\"abc..." ``` The existing "support encrypted attributes defined on columns with default values" test in `encryptable_record_test.rb` shows the intended behavior, but it was not failing without a `reload`.
- Loading branch information
1 parent
0eb42ca
commit c48a830
Showing
4 changed files
with
49 additions
and
4 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
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