On Tue, Apr 28, 2009 at 4:59 AM, MarkMT <[email protected]> wrote:
> 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.


that's why I suggest changing Enum to turn symbols into strings internally:

property :colors, Enum.new(:red, :greed, :blue) will turn symbols into strings

not every string can be turned into symbol but every symbol can be
turned into string,
so it is safe for forms data

any objections from other DM users?
-- 
MK

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to