-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
I'm currently working on syncing a Rails app with a Crystal app using Jennifer and Mosquito to handle my background processing.
I have an ActiveRecord model that uses a hash enum for a particular column, like this:
class MyClass < ApplicationRecord
# bunch of code here
enum type: {
my_type_1: "my type 1",
my_type_2: "my type 2"
}
endI can then use it in this way:
my_class = MyClass.new(type: :my_type_1)
my_class.type # returns: "my_type_1"
my_class.type = "my type 1" # sets the `type` attribute to "my_type_1"
my_class.type = :my_type_1 # sets the `type` attribute to "my_type_1"This doesn't work in Crystal because Enums can only be integer values and that's fine, but it would be nice to make the experience feels like it's a feature of Jennifer.
I can work my solution into the code base and create a PR (it'll probably be at least a few weeks), but I wanted to see if it's a feature you'd like to see added.
Please let me know if you'd like this type of functionality added to Jennifer :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels