Skip to content

Conversation

julienbourdeau
Copy link
Contributor

With ActiveRecord if you do EntitlementValue.update value: true, it will convert the value to "t" because the db column is string.
This is intentional and the serializer will use ActiveModel::Type::Boolean.new.cast("t") to convert it to `true.

In GQL, we rely on "true" and "false" string to display the select box. So we need to convert on read.
On write it's fine because the value will always be casted when returned via the API.

@julienbourdeau julienbourdeau self-assigned this Aug 27, 2025
Copy link
Contributor

@groyoh groyoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't impact the tests ?

@julienbourdeau julienbourdeau merged commit 42ca826 into main Aug 27, 2025
14 checks passed
@julienbourdeau julienbourdeau deleted the fix/ent-config-bool-gql branch August 27, 2025 15:29
julienbourdeau added a commit that referenced this pull request Aug 28, 2025
…#4222)

As I worked on the Go client, I added tests to confirm some behavior and
I found 2 bugs.
- removing a feature or privilege already removed will return a 500. I
believe this should just be a 200.
- same as #4210 for subscriptions
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