Hi all, I recently ran into some surprises working with Enums and this lead to an idea for a new feature that I wanted to discuss some before implementing.
Basically, I wanted to be able to define a custom type by subclassing Enum and had gotten the idea that this would work: class Status < Enum[:on, :off, :disabled, :strawberry] end class ThingWithStatus include DataMapper::Resource property :id, Serial property status, Status end Don't ask where exactly I got this idea, but it seemed reasonable, except that it didn't work at all. I spent a while experimenting (documented at http://justreadthedirections.blogspot.com/2009/03/custom-enumerated-types-in-datamapper.html) and eventually found a workaround. However, I'd really prefer to be able to write things in the first idiom. Does anyone have any objection to me patching Enum to make this work? Will it break your code, or do you have a better suggestion? --Phil --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
