Commit 9956f67
authored
Fix undefined variable when accessing active support encryptor fallback (#31)
Related to: #29
creating new credentials fails with
```
0.4.0/lib/diffcrypt/rails/encrypted_configuration.rb:102:in `decrypt': undefined method `decrypt_and_verify' for nil:NilClass (NoMethodError)
```
it seems `decrypt_and_verify` is never called, thus `@decrypt_and_verify` is not populated and hence results in this error.
Not sure if
```ruby
def active_support_encryptor
@active_support_encryptor = ActiveSupport::MessageEncryptor.new(
[key].pack('H*'),
cipher: @diffcrypt_file.cipher,
)
end
```
was intended to memorize the AS Message Encryptor instance, if so, we can drop in `@active_support_encryptor ||= ...`.1 parent 818adb4 commit 9956f67
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
0 commit comments