-
Notifications
You must be signed in to change notification settings - Fork 0
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
Set of enum #2
Comments
@sled using the alternative DSL a lot of these are already possible, will give more input tomorrow. |
thanks! the first one I already figured out how to do:
However it still allows adding invalid values afterwards (due to the naked
Would be cool if we could find an easy way around this (immutable? cloning? overloading?), otherwise we could rely on validations. |
Jup, was thinking about using a proxy or something, but as there is an unlimited number of methods which modify a Set/Array/Enumerable I decided if's not worth the trouble. Yes, we should handle this using validations, makes more sense. Isn't there a Default.new wrapper class already? |
and yes I agree we should probably provide an empty list by default, care to take a PR? |
A flood of questions:
attribute :selected_months, :set, class_name: Porro::Types::Enum.new(1..12)
attribute :something, :string, default: 'a meaningful default'
attribute :friends, :set, class_name: :string
causesan_instance.friends
to returnnil
wouldn't it make more sense to have something likean_instance.friends << "barry the dog"
The text was updated successfully, but these errors were encountered: