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

Handle ActiveRecord attributes inheriting from EncryptedAttributeType with custom sigs #1904

Merged
merged 1 commit into from
May 21, 2024

Conversation

alex-tan
Copy link
Contributor

Motivation

We have a custom type inheriting from ActiveRecord::Encryption::EncryptedAttributeType with a deserialize method that has a sig specifying the return type.

Previously the column type would hit the ActiveRecord::Type::String branch of type_for_activerecord_value and return ::String because ActiveRecord::Encryption::EncryptedAttributeType inherits from ActiveRecord::Type::String.

Implementation

I added a case statement for ActiveRecord::Encryption::EncryptedAttributeType to type_for_activerecord_value.

Tests

I have.

@alex-tan alex-tan requested a review from a team as a code owner May 20, 2024 14:46
@alex-tan alex-tan changed the title Handle ActiveRecord attributes inheriting from ActiveRecord::Encryption::EncryptedAttributeType with custom sigs Handle ActiveRecord attributes inheriting from EncryptedAttributeType with custom sigs May 20, 2024
@KaanOzkan KaanOzkan added the enhancement New feature or request label May 21, 2024
@KaanOzkan KaanOzkan merged commit 4fbdc2e into Shopify:main May 21, 2024
16 of 17 checks passed
@alex-tan alex-tan deleted the encryption-fix branch May 21, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants