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

Enum array #940

Closed
notramo opened this issue May 5, 2023 · 1 comment · Fixed by #1009
Closed

Enum array #940

notramo opened this issue May 5, 2023 · 1 comment · Fixed by #1009
Labels
feature request A new requested feature / option

Comments

@notramo
Copy link

notramo commented May 5, 2023

Is it possible to use an Enum array somehow? This doesn't work:

enum MyEnum
  First
  Second
end

class MyModel < BaseModel
  table do
    column enum_array : Array(MyEnum)
  end
end
@jwoertink
Copy link
Member

I don't think that's been built yet. You could probably do Array(Int32) then handle some mapping back and forth. I haven't needed this yet, so I'm not sure how to implement it.

@jwoertink jwoertink added the feature request A new requested feature / option label Aug 5, 2023
jwoertink added a commit that referenced this issue Mar 10, 2024
jwoertink added a commit that referenced this issue Mar 23, 2024
* Adds in Array enums. Fixes #940

* Removing this commented code since the actual case is covered in the parent Type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A new requested feature / option
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants