Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Even if use if = false, attr_encrypted uses the encrypted_xxxx column #362

Open
gvn182 opened this issue Feb 17, 2020 · 0 comments
Open

Comments

@gvn182
Copy link

gvn182 commented Feb 17, 2020

I have the following config:

attr_encrypted :content, key: Settings.crypto_key, if: proc { |msg| msg.account.encrypted }

if msg.account.encrypted is set to TRUE, it works like a charm.

if msg.account.encrypted is set to FALSE, the column encrypted_content is filled with uncrypted and the column content is null.

Is this the expected result? Imo if the settings is disabled, it should have no effect in the system. Is there any way to work around it? I need to fill the "content" column when the if: is not met.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant