On Apr 26, 9:36 pm, Michael Klishin <[email protected]> wrote: > On Sun, Apr 26, 2009 at 10:41 PM, MarkMT <[email protected]> wrote: > > I'm just wondering if there is any simple way to get around this. At > > the moment I'm using strings in my Enum definition, which is fine, but > > as I say, I can see the appeal of using symbols and short of using a > > case statement to convert string parameters to symbols, wonder if > > there is a way to do this. And if not, I wonder whether there is > > really any context in which it does make sense to use symbolic Enums. > > We could have Enum use typecasting, but in this case it is likely to > become typecasting > to strings, because you possibly can get a value from a form that Ruby > won't let you to turn into symbol. > > Would it make life easier? > -- > MK
Michael, I may be misunderstanding you, but I think you're saying that it could be possible to actually store symbolic Enum elements as strings so that comparison with the string attribute value would work as required. I guess that would work, though Earl's suggestion is probably simple enough for my purposes. Also, while it's true I guess that some form values may not be able to convert to symbols, presumably those that need to match an Enum element would be ok. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
