We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.to_i
When doing normal where and use the Enum in the where as you might assume it should work. It throws a stack overflow. if I do .to_i it works.
where
I would assume to catch this error with an exception so a stack overflow doesn't happen if it is not supported.
User.where(role: Role::Admin).select.first
will return stack overflow, while:
User.where(role: Role::Admin.to_i).select.first
will work
I use the Enum converter in the model like this:
column role : Role = Role::Guest, converter: Granite::Converters::Enum(Role, Int32)
The text was updated successfully, but these errors were encountered:
I bet this is because it's not casting the Enum when it's in the where method params, but it is converted in the model itself when saving/fetching.
Enum
Sorry, something went wrong.
No branches or pull requests
When doing normal
where
and use the Enum in the where as you might assume it should work. It throws a stack overflow.if I do
.to_i
it works.I would assume to catch this error with an exception so a stack overflow doesn't happen if it is not supported.
will return stack overflow, while:
will work
I use the Enum converter in the model like this:
The text was updated successfully, but these errors were encountered: