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

Fix type of column_type parameter for handle_unknown_type method #997

Merged
merged 2 commits into from
Jun 16, 2022

Conversation

paracycle
Copy link
Member

Motivation

The passed value of column_type parameter is not necessarily always an Object. For example, ActiveSupport::Types::Serialized does not have Object as an ancestor, since it is defined as:

class Serialized < DelegateClass(ActiveModel::Type::Value)

which makes it subclass from BasicObject.

Thanks to @bagmangood for bringing this up.

Implementation

We were using Object as the type for column_type parameter, but we really wanted to use T.untyped instead.

Tests

I added a serialized column to a test case to see this fail before the change and pass after the change.

@paracycle paracycle requested review from bagmangood and a team June 16, 2022 00:28
@paracycle paracycle self-assigned this Jun 16, 2022
The passed value of `column_type` parameter is not necessarily always
an `Object`. For example, `ActiveSupport::Types::Serialized` does not
have `Object` as an ancestor, since it is defined as:
```
class Serialized < DelegateClass(ActiveModel::Type::Value)
```
which makes it subclass from `BasicObject`.

We were using `Object` as the type for `column_type` parameter, but we
really wanted to use `BasicObject` instead.

I added a serialized column to a test case to see this fail before the
change and pass after the change.
@paracycle paracycle force-pushed the uk-fix-method-parameter-type branch from db9706e to 8bebf09 Compare June 16, 2022 17:16
@paracycle paracycle merged commit b429ced into main Jun 16, 2022
@paracycle paracycle deleted the uk-fix-method-parameter-type branch June 16, 2022 20:11
paracycle added a commit that referenced this pull request Jul 1, 2022
Fix type of `column_type` parameter for `handle_unknown_type` method
@paracycle paracycle added the backported Backported to stable branch label Jul 1, 2022
@shopify-shipit shopify-shipit bot temporarily deployed to production July 7, 2022 17:53 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Backported to stable branch bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants