Skip to content

Conversation

@lurodrigo
Copy link
Contributor

Following up on the discussion on #36

The PR intends to better support belongs_to.

To get the type, we first read column_type from opts, and only if it's not available we read type from opts. This way, we can use column_type everywhere if we want to, but we can also keep using type and not break existing code.

For belongs_to, the user can use belongs_to(:post, Post, type: TypeID) to use the default type for the column_type or specify it: belongs_to(:post, Post, type: TypeID, column_type: :string)

My comment here describes a reproducible example of the issue and its solution #36 (comment)

@akramhussein
Copy link

Just bumping this - would be great to see this merged in 🙏

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

Successfully merging this pull request may close these issues.

2 participants